Skip to content

BUG: MultiIndex.union losing dtype when right has duplicates #48591

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

Closed
wants to merge 8 commits into from

Conversation

phofl
Copy link
Member

@phofl phofl commented Sep 16, 2022

  • closes #xxxx (Replace xxxx with the Github issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

@phofl phofl added MultiIndex NA - MaskedArrays Related to pd.NA and nullable extension arrays labels Sep 16, 2022
def test_union_keep_ea_dtype_duplicates_right(any_numeric_ea_dtype):
# GH#48591
arr1 = Series([4, 2], dtype=any_numeric_ea_dtype)
arr2 = Series([2, 1, 1], dtype=any_numeric_ea_dtype)
Copy link
Member

Choose a reason for hiding this comment

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

Could you test with NA in this array too?

Copy link
Member Author

@phofl phofl Sep 19, 2022

Choose a reason for hiding this comment

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

Will add, but depends on #48608 and #48626, this fails currently because the sorting does not work right now

# Conflicts:
#	doc/source/whatsnew/v1.6.0.rst
#	pandas/core/indexes/base.py
# Conflicts:
#	pandas/core/indexes/base.py
@phofl
Copy link
Member Author

phofl commented Oct 7, 2022

This was fixed by another pr

@phofl phofl closed this Oct 7, 2022
@phofl phofl deleted the midx_union_dups branch November 6, 2022 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MultiIndex NA - MaskedArrays Related to pd.NA and nullable extension arrays
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants