-
-
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: Timestamp with unit=Y or unit=M #47266
Conversation
pandas/_libs/tslibs/conversion.pyx
Outdated
if unit in ["Y", "M"]: | ||
# GH#47266 cast_from_unit leads to weird results e.g. with "Y" | ||
# and 150 we'd get 2120-01-01 09:00:00 | ||
ts = np.datetime64(ts, unit.upper()) |
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.
Nit: Is the upper
needed? The units in the if check are already uppered
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 point, 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.
updated+green
* BUG: Timestamp with unit=Y or unit=M * GH refs * remove unnecessary upper
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.