[BUG] merge join key matching is too eager to cast strings
Open
bug
Python
- Dominant language
- C++
- Stars
- 9.8k
- Forks
- 1.1k
- Avg merge
- 3d 6m
- Merged PRs (30d)
- 278
Description
**Describe the bug**
```
import cudf
left = cudf.DataFrame({"key": [1, 2, 3]})
right = cudf.DataFrame({"key": ["1", "4", "5"]})
# Casts both key columns to float64 and merges
got = left.merge(right, on="key", how="outer")
# raises ValueError (merging on int + string column)
expect = left.to_pandas().merge(right.to_pandas(), on="key", how="outer")
```
**Expected behavior**
This should match pandas. A consequence, since merge is also used for Index setops, `union`, `intersection`, and `difference` are buggy.
Contributor guide
Assessment
This issue has not been assessed yet.