-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
ERR: tz conversions at the min/max boundaries should fail if overflow #12677
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
Comments
This works for me in 0.16.2 (e.g. True/False) are printed.
Show an ipython session where you print the version & run the code. |
I've pasted an ipython session below. Sorry, my comments were wrong. Both instances should print True but the latter prints False.
|
Based on your snippet, it looks like the bug is still in 0.18.0. |
So this is fine
This happens because of wrap-around, IOW, once you can't represent a number at the limits it wraps around to the other side.
I suppose you do a doc-note. But trying to anything very near the edge points is bound to hit this issue (not restricted to time zones specifically) |
I suppose we could raise an error like this on:
interested in doing a PR? |
I think raising an error is a good way to handle this. It would also be good to have a function pd.Timestamp.max_tz_localize(tz) which would return the maximal timestamp in that time zone. I would love to help with the PR, but I don't have enough experience in this code base to fix the problem. |
Timestamp comparisons with pd.Timestamp.max don't seem to work correctly when there are timezones, as in the code sample below. This is with Pandas 0.16.2.
Code Sample, a copy-pastable example if possible
output of
pd.show_versions()
The text was updated successfully, but these errors were encountered: