-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: lib.infer_dtype with incompatible intervals #41749
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
cdef: | ||
IntervalValidator validator = IntervalValidator(len(values), | ||
skipna=True) | ||
return validator.validate(values) |
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.
can you remove the IntervalValidator code?
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.
sure, will add that to the upcoming misc branch
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.
kk
return False | ||
else: | ||
raise ValueError(val) | ||
elif util.is_nan(val) or val is None: |
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.
couldn't this be a float nan or NA? (or None)? i am not sure we really specify
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 matches what we do in corresponding libinterval function
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.
got it
ok i think we should open an issue about this (eg letting the missing value be NA) or NaT if it's a datetimelike in a new issue as this is a bit inconsistent with what we allow for missing values in other dtypes
but out of scope for this PR
pandas/_libs/lib.pyx
Outdated
return False | ||
|
||
if closed is None: | ||
# we saw all-NaTs, no actual Intervals |
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.
all-missing / nan?
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.
yah, will update in the follow-on brnach
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.
updated + green
Nothing user-facing.