Skip to content

Commit

Permalink
Add a test for issue 12773 (rapidsai#14529)
Browse files Browse the repository at this point in the history
Closes rapidsai#12773.

Authors:
   - Vyas Ramasubramani (https://github.com/vyasr)
   - Lawrence Mitchell (https://github.com/wence-)

Approvers:
   - GALI PREM SAGAR (https://github.com/galipremsagar)
   - Lawrence Mitchell (https://github.com/wence-)
  • Loading branch information
vyasr authored and karthikeyann committed Dec 12, 2023
1 parent 5f59060 commit 881baeb
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion python/dask_cudf/dask_cudf/tests/test_join.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019-2022, NVIDIA CORPORATION.
# Copyright (c) 2019-2023, NVIDIA CORPORATION.

from functools import partial

Expand Down Expand Up @@ -359,3 +359,22 @@ def test_single_partition():
m2 = dleft.merge(right, how="inner")
assert len(m2.dask) < len(dleft.dask) * 3
assert len(m2) == 100


def test_issue_12773():
# https://github.com/rapidsai/cudf/issues/12773
df1 = cudf.DataFrame({"a": ["a", "b"], "b": [1, 2]})
df2 = cudf.DataFrame({"a": ["a", "c"], "b": [2, 3]})

dleft = dd.from_pandas(df1, npartitions=2).set_index("a")
dright = dd.from_pandas(df2, npartitions=2).set_index("a")

expected = df1.set_index("a").merge(
df2.set_index("a"), left_index=True, right_index=True, how="left"
)
result = dleft.merge(dright, left_index=True, right_index=True, how="left")
dd.assert_eq(
result.compute().to_pandas(),
expected.to_pandas(),
check_index=False,
)

0 comments on commit 881baeb

Please sign in to comment.