-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
ENH: Timestamp +- timedeltalike scalar support non-nano #47313
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
@@ -390,20 +387,31 @@ cdef class _Timestamp(ABCTimestamp): | |||
# TODO: no tests get here | |||
other = ensure_td64ns(other) | |||
|
|||
# TODO: what to do with mismatched resos? |
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.
IMO I would raise and only allow this for matching resos
@@ -853,6 +853,29 @@ def test_to_period(self, dt64, ts): | |||
alt = Timestamp(dt64) | |||
assert ts.to_period("D") == alt.to_period("D") | |||
|
|||
@pytest.mark.parametrize( | |||
"td", [timedelta(days=4), Timedelta(days=4), np.timedelta64(4, "D")] |
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.
So in the future Timedelta
with a non-nano reso will be tested separately to solidify ts._reso/td._reso semantics?
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.
thats the idea, yes
…7313) * ENH: Timestamp +- timedeltalike scalar support non-nano * catch and re-raise OverflowError
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.