We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug Joining MultiIndex with Int64Index does not find common columns.
Steps/Code to reproduce bug This doctest (#9815) fails:
cudf/python/cudf/cudf/core/_base_index.py
Lines 1100 to 1115 in 582cc6e
The common column name a between the MultiIndex lhs and Int64Index rhs is not found. The following exception is raised:
a
lhs
rhs
Failed example: lhs.join(rhs, how='inner') Exception raised: Traceback (most recent call last): File "/home/bdice/code/compose/etc/conda/cuda_11.5/envs/rapids/lib/python3.8/doctest.py", line 1336, in __run exec(compile(example.source, filename, "single", File "<doctest BaseIndex.join[5]>", line 1, in <module> lhs.join(rhs, how='inner') File "/home/bdice/code/cudf/python/cudf/cudf/core/_base_index.py", line 1166, in join output = lhs._merge(rhs, how=how, on=on, sort=sort) File "/home/bdice/code/cudf/python/cudf/cudf/core/frame.py", line 3819, in _merge return merge_cls( File "/home/bdice/code/cudf/python/cudf/cudf/core/join/join.py", line 83, in __init__ self._validate_merge_params( File "/home/bdice/code/cudf/python/cudf/cudf/core/join/join.py", line 413, in _validate_merge_params raise ValueError("No common columns to perform merge on") ValueError: No common columns to perform merge on
Expected behavior Pandas matches the expected behavior of the docstring:
>>> lhs = pd.DataFrame({"a": [2, 3, 1], "b": [3, 4, 2]}).set_index(["a", "b"]).index >>> lhs MultiIndex([(2, 3), (3, 4), (1, 2)], names=['a', 'b']) >>> rhs = pd.DataFrame({"a": [1, 4, 3]}).set_index("a").index >>> rhs Int64Index([1, 4, 3], dtype='int64', name='a') >>> lhs.join(rhs) MultiIndex([(2, 3), (3, 4), (1, 2)], names=['a', 'b']) >>> lhs.join(rhs, how="inner") MultiIndex([(3, 4), (1, 2)], names=['a', 'b'])
The text was updated successfully, but these errors were encountered:
Fix join of MultiIndex to Index with one column and overlapping name. (…
e82cc62
…#9830) This PR resolves #9823 Authors: - Vyas Ramasubramani (https://github.com/vyasr) - Ashwin Srinath (https://github.com/shwina) Approvers: - Bradley Dice (https://github.com/bdice) URL: #9830
Run doctests. (#9815)
e24fa8f
This PR adds doctests and resolves #9513. Several issues were found by running doctests that have now been resolved: - [x] #9821 - [x] #9822 - [x] #9823 - [x] #9824 - [x] #9825 - [x] #9826 - [x] #9827 - [x] #9828 (workaround by deleting doctests) - [x] #9829 Authors: - Bradley Dice (https://github.com/bdice) Approvers: - Ashwin Srinath (https://github.com/shwina) - Vyas Ramasubramani (https://github.com/vyasr) URL: #9815
Successfully merging a pull request may close this issue.
Describe the bug
Joining MultiIndex with Int64Index does not find common columns.
Steps/Code to reproduce bug
This doctest (#9815) fails:
cudf/python/cudf/cudf/core/_base_index.py
Lines 1100 to 1115 in 582cc6e
The common column name
a
between the MultiIndexlhs
and Int64Indexrhs
is not found. The following exception is raised:Expected behavior
Pandas matches the expected behavior of the docstring:
The text was updated successfully, but these errors were encountered: