-
-
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: move NumericIndex._engine_type and .inferred_type to Index #50940
DEPR: move NumericIndex._engine_type and .inferred_type to Index #50940
Conversation
needs rebase |
0cff92d
to
2ccf1f4
Compare
Ping. |
"u": "integer", | ||
"f": "floating", | ||
"c": "complex", | ||
}[self.dtype.kind] |
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 doesnt change anything for our nullable dtypes, but in principle could be an API change for 3rd party EAs. worth caring about @mroeschke ?
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.
I think this would be a good API change for ArrowDtype
, but not sure what else subsequently relies on the output of Index.inferred_type
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 change I proposed isn't strictly needed, I just added it as an optimization. I could also remove it here and try do add something similar to lib.infer_dtype
instead. It's also a better location for this IMO and at least we can discuss if there's some down side to doing this seperately from the NumericIndex
removal process.
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.
to avoid the api change you can do:
if isinstance(self.dtype, np.dtype) and self.dtype.kind in "iufc":
[...]
return lib.infer_dtype(...)
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.
Ok, I can do it like that.
Updated. |
Thanks @topper-123 |
Moves
_engine_type
&inferred_type
fromNumericIndex
toIndex
in preparation to removeNumericIndex
and include numpy int/uint/float64 in the baseIndex
.xref #42717.