-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
REGR: Index.union loses python string dtype #54778
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
Conversation
Co-authored-by: Matthew Roeschke <[email protected]>
@@ -5194,7 +5194,7 @@ def _from_join_target(self, result: np.ndarray) -> ArrayLike: | |||
""" | |||
if isinstance(self.values, BaseMaskedArray): | |||
return type(self.values)(result, np.zeros(result.shape, dtype=np.bool_)) | |||
elif isinstance(self.values, ArrowExtensionArray): | |||
elif isinstance(self.values, (ArrowExtensionArray, StringArray)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just out of interest, why can't this be done for all EAs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We enhanced this when we added _get_join_target
. Previously we returned result unchanged, so not sure if this would potentially break stuff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok - this looks fine to be, but would prefer if someone more familiar with core/indexes could take a look too
Thanks @phofl |
…ring dtype) (#54813) Backport PR #54778: REGR: Index.union loses python string dtype Co-authored-by: Patrick Hoefler <[email protected]>
* REGR: Index.union loses python string dtype * Update pandas/core/indexes/base.py Co-authored-by: Matthew Roeschke <[email protected]> --------- Co-authored-by: Matthew Roeschke <[email protected]>
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.cc @mroeschke