Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
ERR: tz conversions at the min/max boundaries should fail if overflow #12677
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
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.
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)
Mar 21, 2016
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.