-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
REF: delta_to_nanoseconds handle non-nano #47191
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
REF: delta_to_nanoseconds handle non-nano #47191
Conversation
except NotImplementedError: | ||
if allow_year_month: | ||
td64 = ensure_td64ns(delta) | ||
return delta_to_nanoseconds(td64, reso=reso) |
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.
Should reso
always be NPY_FR_ns
here? If so, should be safer to just hardcode reso=NPY_FR_ns
?
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 update
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.
wait, no. this is correct as-is
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.
Ah so this branch converts delta
to ns no matter what to ensure the recursive call will exit appropriately the next time. Got it
is_timedelta64_object(other) | ||
and get_datetime64_unit(other) == NPY_DATETIMEUNIT.NPY_FR_GENERIC | ||
): | ||
# TODO: deprecate allowing this? We only get here |
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.
Deprecate specifically adding a np.timedelta64
object without a unit (and not the interval adding behavior)?
If so, +1.
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.
correct
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.