-
-
Notifications
You must be signed in to change notification settings - Fork 18.8k
BUG: Fix inconsistency with DateOffset near DST #61870
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
37aeccd
cbcd775
cd7c0d1
da7eb58
e02dc29
e8f5e7b
91397e3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1095,9 +1095,11 @@ def test_dateoffset_misc(): | |
|
||
@pytest.mark.parametrize("n", [-1, 1, 3]) | ||
def test_construct_int_arg_no_kwargs_assumed_days(n): | ||
from dateutil.relativedelta import relativedelta | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can this go at the top of the file |
||
|
||
# GH 45890, 45643 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. update |
||
offset = DateOffset(n) | ||
assert offset._offset == timedelta(1) | ||
assert offset._offset == relativedelta(days=1) | ||
result = Timestamp(2022, 1, 2) + offset | ||
expected = Timestamp(2022, 1, 2 + n) | ||
assert result == expected | ||
|
@@ -1227,3 +1229,11 @@ def test_is_yqm_start_end(): | |
def test_multiply_dateoffset_typeerror(left, right): | ||
with pytest.raises(TypeError, match="Cannot multiply"): | ||
left * right | ||
|
||
|
||
def test_dateoffset_days_vs_n_near_dst_transition(): | ||
ts = Timestamp("2022-10-30", tz="Europe/Brussels") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. GH ref |
||
|
||
offset_days = ts + offsets.DateOffset(days=1) | ||
offset_n = ts + offsets.DateOffset(1) | ||
assert offset_days == offset_n |
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.
the comment here needs adjusting?