-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
DEPR: Remove NumericIndex from tests/indexes/numeric.py #51013
Conversation
@@ -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 |
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.
What's this used for?
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.
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.
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.
Got you, thx
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.
Small comment, otherwise lgtm
Thx @topper-123 |
Removing
NumericIndex
from tests/indexes/numeric.py and replaces it withIndex
in preparation for removal ofNumericIndex
from tests/indexes/numeric.py.xref #42717.