-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
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
API: Make 'D' & offsets.Day always operate as calendar day instead of 24 Hour #41943
Comments
Giving this another shot, still have 563 failing tests on the current branch. Some points to figure out and/or decide:
Will update this as I go. |
Not sure if #22864 (comment) provides any answers to the above |
What's the suggestion for when the result would fall on an ambiguous or non-existent timestamp? Like Timestamp('2015-03-28T2:30').tz_localize('Europe/Warsaw') + pd.tseries.offsets.Day(1) Just raise? |
i think so, yes. |
From 2021-06-09 dev call, new discussion of #22864
Problem: Frequency string
'D'
andpd.offsets.Day
is defined to be a fixed 24 hour period since it's a subclass ofTick
.In the context of timezones with a DST crossing,
'D'
acts as a calendar day (23/24/25H) instead for the following operations:pd.date_range(start, end, freq="D")
df.resample("D")...
Original Settled Solution: Deprecate all behavior where Frequency string
'D'
andpd.offsets.Day
is a fixed 24 hours in favor of"24H"
. A private_Day
offset would be used where appropriate internally and swapped out once the deprecation is enforced.(Note: I lost steam last time catching all the warnings issued in the testing suite given the above solution touches datetimes, timedeltas, offsets, methods, etc)
Other Solutions
"'DayDST'"/pd.offsets.CalendarDay"
, that users can migrate to.Tick
s (Day
is a subclass) all together since they are redundant withTimedelta
scc @pandas-dev/pandas-core
(@jbrockmendel) Updating with checkboxes to keep track of issues I think this would resolve:
The text was updated successfully, but these errors were encountered: