-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
BUG: pd.Timedelta(big_int, unit=W) silent overflow #47268
Conversation
@@ -732,6 +732,7 @@ Timedelta | |||
^^^^^^^^^ | |||
- Bug in :func:`astype_nansafe` astype("timedelta64[ns]") fails when np.nan is included (:issue:`45798`) | |||
- Bug in constructing a :class:`Timedelta` with a ``np.timedelta64`` object and a ``unit`` sometimes silently overflowing and returning incorrect results instead of raising ``OutOfBoundsTimedelta`` (:issue:`46827`) | |||
- Bug in constructing a :class:`Timedelta` from a large integer or float with ``unit="W"`` silently overflowing and returning incorrect results instead of raising ``OutOfBoundsTimedelta`` (:issue:`47268`) |
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.
Could you also add a note in the Other API Changes
section mentioning that various timstamp/timedelta constructors that would overflow now raise a OutOfBoundsTimedelta
/OutOfBoundsTimestamp
instead of an OverflowError
(they appear to be based off of different subclasses).
Should hopefully be a catchall for all these improvements you've been making
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.
good idea, updated
Thanks @jbrockmendel |
* BUG: pd.Timedelta(big_int, unit=W) silent overflow * GH ref * note exception changes in whatsnew
According to the release notes of pandas 1.5.0
However, |
No. PR to fix cases we missed would be welcome. |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.