Skip to content
New issue

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

Fix joining on indexes with duplicate level names #9137

Merged
merged 2 commits into from
Aug 28, 2021

Conversation

shwina
Copy link
Contributor

@shwina shwina commented Aug 27, 2021

Previously, joining on indexes with duplicate level names yielded an error:

In [9]: lhs
Out[9]:
     a
x x
1 1  1
  2  2
  3  3

In [10]: rhs
Out[10]:
     b
x x
1 1  1
  4  2
  3  3

In [11]: lhs.join(rhs) # KeyError

@shwina shwina requested a review from a team as a code owner August 27, 2021 20:07
@shwina shwina added bug Something isn't working Python Affects Python cuDF API. non-breaking Non-breaking change labels Aug 27, 2021
Comment on lines +1527 to +1532
# if `multiindex` has two or more levels that
# have the same name, then `multiindex.to_frame()`
# results in a DataFrame containing only one of those
# levels. Thus, set `names` to some tuple of unique values
# and then call `multiindex.to_frame(name=names)`,
# which preserves all levels of `multiindex`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an excellent comment, as it's quite unclear from the following line of code why it's necessary

@galipremsagar galipremsagar added the 5 - Ready to Merge Testing and reviews complete, ready to merge label Aug 27, 2021
@codecov
Copy link

codecov bot commented Aug 27, 2021

Codecov Report

❗ No coverage uploaded for pull request base (branch-21.10@4d8e401). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@               Coverage Diff               @@
##             branch-21.10    #9137   +/-   ##
===============================================
  Coverage                ?   10.83%           
===============================================
  Files                   ?      114           
  Lines                   ?    19102           
  Branches                ?        0           
===============================================
  Hits                    ?     2070           
  Misses                  ?    17032           
  Partials                ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4d8e401...7e104d8. Read the comment docs.

@galipremsagar
Copy link
Contributor

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 1d4a2fb into rapidsai:branch-21.10 Aug 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to Merge Testing and reviews complete, ready to merge bug Something isn't working non-breaking Non-breaking change Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants