-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
REF: de-duplicate _wrap_joined_index in MultiIndex #36313
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
if isinstance(self, ABCMultiIndex): | ||
name = self.names if self.names == other.names else None | ||
else: | ||
name = get_op_result_name(self, other) |
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.
hmm why can't we do this in get_op_result_name?
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.
i considered that, decided against it because it meant additional overhead in a lot of places
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.
kk
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.
assume you are going to use names_compat in more places
if isinstance(self, ABCMultiIndex): | ||
name = self.names if self.names == other.names else None | ||
else: | ||
name = get_op_result_name(self, other) |
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.
kk
@@ -152,6 +153,25 @@ def _codes_to_ints(self, codes): | |||
return np.bitwise_or.reduce(codes, axis=1) | |||
|
|||
|
|||
def names_compat(meth): |
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.
type if you can
Follow-up to #36282
We'll also be able to clean up MultiIndex special-casing in _reindex_non_unique. I expect others but cant say for sure yet.