-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Timestamp.replace handle out-of-pydatetime range #50348
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
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.
Looks like the numpy dev build is failing
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.
gh numbers missing, but other than that looks good, nice!
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 sorry, the numpy-dev failure seems legit
2022-12-26T21:13:19.3570839Z _______________________ test_add_out_of_pydatetime_range _______________________
2022-12-26T21:13:19.3571781Z [gw1] linux -- Python 3.10.8 /home/runner/micromamba/envs/test/bin/python
2022-12-26T21:13:19.3572026Z
2022-12-26T21:13:19.3572174Z def test_add_out_of_pydatetime_range():
2022-12-26T21:13:19.3572564Z # don't raise in Timestamp.replace
2022-12-26T21:13:19.3572976Z ts = Timestamp(np.datetime64("-20000-12-31"))
2022-12-26T21:13:19.3573268Z off = YearEnd()
2022-12-26T21:13:19.3573482Z
2022-12-26T21:13:19.3573705Z result = ts + off
2022-12-26T21:13:19.3574104Z expected = Timestamp(np.datetime64("-19999-12-31"))
2022-12-26T21:13:19.3574417Z > assert result == expected
2022-12-26T21:13:19.3574932Z E AssertionError: assert Timestamp('1973-12-31 00:00:00') == Timestamp('-19999-12-31 00:00:00')
yah i havent been able to reproduce the npdev failure. will add GH refs in the next commit once i figure that out |
@seberg any thoughts on reproducing this locally? |
Hmmm, unfortunately, can't repro on M1 and I can't think of anything that may have changed in NumPy. |
ooh, looks like this fixes #51291, nice! |
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.
Looks good to me
Got a comment about simplifying something, but not important / blocking
btw I can't reproduce this locally with numpy-dev, the correct answer shows for me |
Co-authored-by: Marco Edward Gorelli <[email protected]>
let's ship this - thanks @jbrockmendel |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.