Skip to content

Conversation

jbrockmendel
Copy link
Member

@jorisvandenbossche jorisvandenbossche changed the title BUG: Fix dir(interval_index), closes #27571 BUG: Fix dir(interval_index) Jul 30, 2019
@jorisvandenbossche jorisvandenbossche added this to the 0.25.1 milestone Jul 30, 2019
@jorisvandenbossche jorisvandenbossche added the Regression Functionality that used to work in a prior pandas version label Jul 30, 2019
Copy link
Member

@jorisvandenbossche jorisvandenbossche left a 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

@jbrockmendel
Copy link
Member Author

I think the proper fix is to infer_dtype for letting it handle EAs correctly

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:
Copy link
Contributor

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

Copy link
Member Author

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

Copy link
Contributor

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?

Copy link
Member Author

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

@jreback jreback merged commit 9614789 into pandas-dev:master Aug 1, 2019
@jreback
Copy link
Contributor

jreback commented Aug 1, 2019

thanks @jbrockmendel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Regression Functionality that used to work in a prior pandas version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: dir(IntervalIndex()) raises
4 participants