Skip to content
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

DEPR: Remove NumericIndex from tests/indexes/numeric.py #51013

Merged

Conversation

topper-123
Copy link
Contributor

@topper-123 topper-123 commented Jan 27, 2023

Removing NumericIndex from tests/indexes/numeric.py and replaces it with Index in preparation for removal of NumericIndex from tests/indexes/numeric.py.

xref #42717.

@@ -50,19 +43,17 @@ def float_index(self, dtype):
return self._index_cls([0.0, 2.5, 5.0, 7.5, 10.0], dtype=dtype)

def test_repr_roundtrip(self, index):
tm.assert_index_equal(eval(repr(index)), index, exact=True)
from pandas.core.api import NumericIndex # noqa: F401
Copy link
Member

Choose a reason for hiding this comment

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

What's this used for?

Copy link
Contributor Author

@topper-123 topper-123 Jan 28, 2023

Choose a reason for hiding this comment

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

This is just temporary crutch until we remove NumericIndex. So it will be gone again in a few PRs.

The issue is that ATM repr(index) gives e.g. "NumericIndex([1, 2, 3], dtype='int32')". To call eval on this, we need NumericIndex the in namespace.

Copy link
Member

Choose a reason for hiding this comment

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

Got you, thx

Copy link
Member

@phofl phofl left a comment

Choose a reason for hiding this comment

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

Small comment, otherwise lgtm

@phofl phofl merged commit 852518e into pandas-dev:main Jan 28, 2023
@phofl phofl added this to the 2.0 milestone Jan 28, 2023
@phofl phofl added the Deprecate Functionality to remove in pandas label Jan 28, 2023
@phofl
Copy link
Member

phofl commented Jan 28, 2023

Thx @topper-123

@topper-123 topper-123 deleted the remove_NumericIndex_from_numeric_tests branch January 28, 2023 13:36
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.

2 participants