-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Let check_exact_index default to True for integers #58189
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
Conversation
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.
Sorry for the late review here.
- Could you add to the docstring
exact
parameter that this applies to theindex
in 3.0? - Could you add a whatsnew note in
v3.0.0.rst
- Could you add some tests?
No problem at all. Not sure how many tests are needed but I think this should be sufficient |
pandas/_testing/asserters.py
Outdated
all(is_numeric_dtype(dtype) for dtype in left_index_dtypes) | ||
and not any(is_float_dtype(dtype) for dtype in left_index_dtypes) |
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.
You could check dtype.kind in "iu"
to check integer types in one go
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.
Brilliant! That doesn't seem to work for multiindexes (as in I can't just use this on index.dtype
) as the dtype is always object (why?)
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.
That doesn't seem to work for multiindexes
Probably because MultiIndex can be composed of levels that are mixed types so object
is the safest type
Thanks @Aloqeely |
…8189) * Default check_exact_index to True for integers * Fix pyright issue * fix logic for multiindex * Pre-commit stuff * Address review comments --------- Co-authored-by: Abdulaziz Aloqeely <[email protected]>
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.