Skip to content

DEPR: Remove NumericIndex from indexes/range.py #51095

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

Conversation

topper-123
Copy link
Contributor

Remove NumericIndex from pandas/core/indexes/range.py. There are a few instances left that will be removed when NumericIndexis removed proper.

xref #42717.

# type "Type[RangeIndex]" in supertype "Index"
@cache_readonly
def _constructor(self) -> type[NumericIndex]: # type: ignore[override]
def _constructor(self) -> type[Index]:
"""return the class to use for construction"""
return NumericIndex
Copy link
Member

Choose a reason for hiding this comment

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

this is going to be updated to return Index before long?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, couldn't do it here because there is some issue with empty indexes (Index([]) and NumericIndex([]) are not the same).

@topper-123 topper-123 self-assigned this Feb 1, 2023
@topper-123 topper-123 force-pushed the remove_NumericIndex_from_RangeIndex branch from c546c1b to 2c7cb6f Compare February 1, 2023 10:42
@topper-123 topper-123 removed their assignment Feb 1, 2023
@phofl phofl added the Deprecate Functionality to remove in pandas label Feb 1, 2023
@phofl phofl added this to the 2.0 milestone Feb 1, 2023
@phofl phofl merged commit 936da9e into pandas-dev:main Feb 1, 2023
@phofl
Copy link
Member

phofl commented Feb 1, 2023

thx @topper-123

@topper-123 topper-123 deleted the remove_NumericIndex_from_RangeIndex branch February 1, 2023 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants