-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
REF: share IntervalIndex._check_method with CategoricalIndex #37871
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
pandas/core/indexes/category.py
Outdated
@@ -704,3 +696,18 @@ def _delegate_method(self, name: str, *args, **kwargs): | |||
if is_scalar(res): | |||
return res | |||
return CategoricalIndex(res, name=self.name) | |||
|
|||
|
|||
def check_indexing_method(self, method): |
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.
why aren't you using pandas.core.missing.clean_fill_method?
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.
because thats checking that the method is valid, whereas this is raising whenever the method is non-None.
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 seems an odd place to put this inside a sub-class of index, i would locate elsewhere, maybe pandas.core.indexes.api (which btw we should rename to something better)
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.
its definitely odd. we could put it in ExtensionIndex and then have DatetimeLikeIndex override it
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 thats a bit better place
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.
updated+green
We're about to simplify the tar out of CategoricalIndex indexing
No description provided.