Skip to content

Commit c077c71

Browse files
committed
Remove arg freq and add test
1 parent 7120725 commit c077c71

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

pandas/tests/arithmetic/test_datetime64.py

+8
Original file line numberDiff line numberDiff line change
@@ -1370,6 +1370,14 @@ def test_dt64arr_add_sub_DateOffset(self, box_with_array):
13701370
tm.assert_equal(result, exp)
13711371
tm.assert_equal(result2, exp)
13721372

1373+
# GH 26258
1374+
date = date_range(start='01 Jan 2014', end='01 Jan 2017', freq='AS')
1375+
offset = pd.DateOffset(months=3, days=10)
1376+
result = date + offset
1377+
exp = DatetimeIndex([Timestamp('2014-04-11'), Timestamp('2015-04-11'),
1378+
Timestamp('2016-04-11'), Timestamp('2017-04-11')])
1379+
tm.assert_equal(result, exp)
1380+
13731381
# TODO: __sub__, __rsub__
13741382
def test_dt64arr_add_mixed_offset_array(self, box_with_array):
13751383
# GH#10699

pandas/tseries/offsets.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def apply_index(self, i):
273273
kwds.get('months', 0)) * self.n)
274274
if months:
275275
shifted = liboffsets.shift_months(i.asi8, months)
276-
i = type(i)(shifted, freq=i.freq, dtype=i.dtype)
276+
i = type(i)(shifted, dtype=i.dtype)
277277

278278
weeks = (kwds.get('weeks', 0)) * self.n
279279
if weeks:

0 commit comments

Comments
 (0)