-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Unclear logic for which offsets are _adjust_dst #18977
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
That was added in #9623. Basically some rules need to remove the timezone, apply the rule, and then add the timezone back in order to get the right offset after applying the rule. These are mostly rules that use |
@rockg thanks, that's a helpful reference. Unfortunately you've made the mistake of volunteering yourself for follow-up questions.
Luckily we're down to the base
The sanity test I've been using recently is to check that As for And last, there's a roundup in #18854 of offsets-related issues. A handful of them are along the lines of "if anybody knows what was intended here please let me know". If you find yourself with nothing better to do... |
The singular/plural is confusing for That sanity check isn't clear that it will work properly over DST transitions. At least before this change was made, I believe that logic will work but the ts + offset will result in the wrong DST, but subtracting the offset will "undo" the incorrect DST. The tests I added in the PR explicitly test that the DST transitions are correct and that is the litmus test for these types of operations. It's not clear with the transition to the cython routines if the |
Also, the test you describe is another completely necessary test of offset operations. |
The base class
DateOffset
has_adjust_dst = False
. Then almost every subclass overrides it toTrue
. The exceptions being:BusinessHour
,CustomBusinessHour
LastWeekOfMonth
(in contrast toWeekOfMonth
, seems like a likely mistake)Tick
and subclasses.The
Tick
classes make sense since those are glorifiedTimedeltas
.BusinessHour
I could imagine being special because it is sub-daily, but I'd appreciate a confirmation that this is intentional.LastWeekofMonth
I suspect is a mistake.I'll roll this into an existing issue and close once I get the lay of the land.
The text was updated successfully, but these errors were encountered: