-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Better error message for OOB result #32499
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
pandas/_libs/tslibs/c_timestamp.pyx
Outdated
@@ -287,9 +287,13 @@ cdef class _Timestamp(datetime): | |||
if (PyDateTime_Check(self) | |||
and (PyDateTime_Check(other) or is_datetime64_object(other))): | |||
if isinstance(self, _Timestamp): | |||
other = type(self)(other) | |||
both_timestamps = isinstance(other, _Timestamp) |
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.
@jbrockmendel can you take another look when you get a chance? Needed to change some things around to ensure that Timestamp - datetime.datetime
didn't raise (since we internally convert the datetime to a Timestamp).
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 looks like you're avoiding re-calling the constructor if we already have a Timestamp. Is that necessary? The constructor was recently optimized for the already-Timestamp case
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.
never mind, i get it now
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.
maybe add a comment to the effect of "we need to know if we started with both-Timestamps to determine whether to raise on Overflow, see GH#..."
LGTM |
The doc build failure is unrelated:
|
very nice @TomAugspurger |
Closes #31774