Skip to content

Commit

Permalink
Add NotImplementedError when on is specified in DataFrame.join. (NVID…
Browse files Browse the repository at this point in the history
…IA#11275)

Resolves NVIDIA#8364

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

Approvers:
  - GALI PREM SAGAR (https://github.com/galipremsagar)

URL: rapidsai/cudf#11275
  • Loading branch information
vyasr authored Jul 15, 2022
1 parent 7342a36 commit 11ed8bc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions python/cudf/cudf/core/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -3807,6 +3807,8 @@ def join(
- *other* must be a single DataFrame for now.
- *on* is not supported yet due to lack of multi-index support.
"""
if on is not None:
raise NotImplementedError("The on parameter is not yet supported")

df = self.merge(
other,
Expand Down
7 changes: 7 additions & 0 deletions python/cudf/cudf/tests/test_joining.py
Original file line number Diff line number Diff line change
Expand Up @@ -2181,3 +2181,10 @@ def test_join_multiindex_index():
expect = lhs.to_pandas().join(rhs.to_pandas(), how="inner")
got = lhs.join(rhs, how="inner")
assert_join_results_equal(expect, got, how="inner")


def test_dataframe_join_on():
"""Verify that specifying the on parameter gives a NotImplementedError."""
df = cudf.DataFrame({"a": [1, 2, 3]})
with pytest.raises(NotImplementedError):
df.join(df, on="a")

0 comments on commit 11ed8bc

Please sign in to comment.