-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: tslib.tz_convert and tslib.tz_convert_single may output different result in DST #7798
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
Conversation
Perf result. I think it increases a performance of
|
OK, done.
|
And test in #7633 takes few seconds.
|
Should we add a test for the fall DST transition similar to what you did for spring? I understand there is not really any specific "spring" code per se, but sometimes strange things popup. Otherwise the changes look fine. |
@rockg Yep, added tests. Could you check whether it is valid, otherwise lmk better one? |
|
||
def test_tslib_tz_convert_dst(self): | ||
# Start DST | ||
idx = date_range('2014-03-08 23:00', '2014-03-09 09:00', freq='1min', tz='UTC') |
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.
can you add a freq loop around this with several freqs? (I know a bit annoying as you have to specify the result as well). you have T
, maybe H
and D
? (as D should be unaffected by the DST transitions, while T and H are)
That's exactly what I was thinking. |
OK, modified test to cover other freqs. |
Added the fix for #7880. |
@jreback I think it is ready, lmk if anything. |
looks fine, what was the problem with #7880 ? (e.g. what fixed it) |
Currently, it includes 2 fixes (described in release note)
|
BUG: tslib.tz_convert and tslib.tz_convert_single may output different result in DST
thanks! |
These functions may return different result in case of DST. There seems to be 2 problems:
tslib.tz_convert
checks DST and changedeltas
by adjustingpos
by 1. If input has time-gaps more than 2 DST spans, result will be incorrect.tslib.tz_convert_single
results incorrect if input is just on DST edge.Note
Additionally, it was modifed to close #7880 also.