Skip to content

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

Merged
merged 4 commits into from
Nov 17, 2020

Conversation

jbrockmendel
Copy link
Member

No description provided.

@jreback jreback added Interval Interval data type Refactor Internal refactoring of code labels Nov 15, 2020
@jreback jreback added this to the 1.2 milestone Nov 15, 2020
@@ -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):
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

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)

Copy link
Member Author

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

Copy link
Contributor

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

Copy link
Member Author

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

@jreback jreback merged commit bf7dba7 into pandas-dev:master Nov 17, 2020
@jbrockmendel jbrockmendel deleted the ref-check_method branch November 17, 2020 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Interval Interval data type Refactor Internal refactoring of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants