-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Fix dir(interval_index) #27653
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
BUG: Fix dir(interval_index) #27653
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.
I think the proper fix is to infer_dtype
for letting it handle EAs correctly (#23553), but fine with this as a stop-gap for 0.25.1
Yah, the fix I'm working on locally makes infer_dtype handle interval correctly. Getting all EAs right is out of scope. |
inferred_dtype = lib.infer_dtype(values, skipna=True) | ||
try: | ||
inferred_dtype = lib.infer_dtype(values, skipna=True) | ||
except ValueError: |
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.
infer_dtype should never raise
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.
lib.pyx L1207 specifically raises ValueError
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, can you make an issue to fix the doc-string in infer_dtype. is possible to handle this inside infer_dtype rather than raise? or is this meant as a tactical fix?
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.
is possible to handle this inside infer_dtype rather than raise? or is this meant as a tactical fix?
the interval case is fixed by this PR inside infer_dtype, so catching the error here is just a dir-should-never-raise thing. the more general infer_dtype fixes are part of a larger push to recognize EADtypes correctly, yah
thanks @jbrockmendel |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff