NVIDIA / NVIDIA/cudf

[BUG] merge join key matching is too eager to cast strings

Open
#14,571 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.