Skip to content

CLN: Clean-up numeric index dtype validation #41063

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

The use of a dict with _typ attributes as keys in NumericIndex._validate_dtype makes it complicated to subclass numeric indexes and change the subclass' _typ attribute.

This PR makes the dtype validation in NumericIndex._validate_dtype not dependent on the value of the _typ attribute, making subclassing more robust.

Copy link
Member

@jbrockmendel jbrockmendel left a comment

Choose a reason for hiding this comment

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

LGTM pending green

@jreback jreback added Dtype Conversions Unexpected or buggy dtype conversions Refactor Internal refactoring of code labels Apr 20, 2021
@jreback jreback added this to the 1.3 milestone Apr 20, 2021
@jreback jreback added the Typing type annotations, mypy/pyright type checking label Apr 20, 2021
@topper-123 topper-123 force-pushed the cln_numerice_index_dtype_validation branch from d3fc502 to 7d5e7a5 Compare April 21, 2021 07:09
@topper-123 topper-123 force-pushed the cln_numerice_index_dtype_validation branch from 7d5e7a5 to e58da38 Compare April 21, 2021 09:59
@jreback jreback merged commit 1749a81 into pandas-dev:master Apr 21, 2021
@jreback
Copy link
Contributor

jreback commented Apr 21, 2021

thanks @topper-123

@topper-123 topper-123 deleted the cln_numerice_index_dtype_validation branch April 21, 2021 12:50
yeshsurya pushed a commit to yeshsurya/pandas that referenced this pull request May 6, 2021
JulianWgs pushed a commit to JulianWgs/pandas that referenced this pull request Jul 3, 2021
@topper-123 topper-123 added the Index Related to the Index class or subclasses label Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dtype Conversions Unexpected or buggy dtype conversions Index Related to the Index class or subclasses Refactor Internal refactoring of code Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants