-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Hour overflow in tz-aware datetime conversions #13306
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
I get exactly the output you have above. What exactly is the issue? |
Sorry for being unclear, the output is wrong - these timestamps are not an hour apart. The output above is the actual (buggy) output, not what it should be. |
maybe the example is not clear. Can you show something and have an expected which is obvious. |
The expected output is the correct timedelta - updated to reflect that. |
|
So we are not converting to UTC somewhere. Should be a straightforward fix. want to do a pull-request?
|
Please look at the second half of my comment. The (perhaps known?) bug is in tz_convert() itself, whose implementation assumes the array is sorted. |
@dlpd you are reaching into the implementation. So not really sure what you are doing. You would have to demonstrate a bug using the public API which you did for the case above but not for anything else. |
@jreback Thanks for the comments. You wrote:
My point is that the bug is in the tz-conversion itself, not lack thereof. If pandas.tslib.tz_convert() is not considered public, I'm happy to reproduce with DatetimeIndex.tz_convert() which is. If you trace the execution of the timedelta computation, you will see that these two examples are actually the same. |
well if you'd like to submit a pull request would be great |
Comparison of tz-aware timestamps fails across DST boundaries. The comment in tslib.pyx:3845
perhaps implies this is a known problem that was never resolved, so apologies if a new issue is not appropriate.
Self contained example
Output
Expected output:
Actual output of timedelta computation:
Computed timedelta for rows after the 2008-12-12 date are off by an hour.
Output of tz_convert:
output of
pd.show_versions()
The text was updated successfully, but these errors were encountered: