-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DEPR: Remove NumericIndex.__new__ + related methods #51050
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.__new__ + related methods #51050
Conversation
@@ -619,6 +619,7 @@ Other API changes | |||
new DataFrame (shallow copy) instead of the original DataFrame, consistent with other | |||
methods to get a full slice (for example ``df.loc[:]`` or ``df[:]``) (:issue:`49469`) | |||
- Disallow computing ``cumprod`` for :class:`Timedelta` object; previously this returned incorrect values (:issue:`50246`) | |||
- Instantiating an :class:`Index` with an numeric numpy dtype with data containing :class:`NA` and/or :class:`NaT` now raises a ``ValueError``. Previously a ``TypeError`` was raised (:issue:`51050`) |
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.
does this match what we raise with Series or DataFrame?
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.
Yes, so this is also an unification wrt. the errors messages the users get, when they do this kind of mistake.
Thanks @topper-123 |
* Remove NumericIndex.__new__ (almost) + various methods * adds GH-number * fix errors * fix error II
Removes methods
__new__
,_ensure_array
,_validate_dtype
,_ensure_dtype
&_assert_safe_casting
fromNumericIndex
. Also adds needed contents toIndex
and other locations as needed.Some scaffolding is added to
NumericIndex.__new__
, but that will be removed in the next PR.xref #42717.