Skip to content

Commit 39d8ee7

Browse files
committed
whatsnew, gh references in tests
1 parent f1147af commit 39d8ee7

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

doc/source/whatsnew/v0.23.0.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ Datetimelike API Changes
586586
- Operations between a :class:`Series` with dtype ``dtype='datetime64[ns]'`` and a :class:`PeriodIndex` will correctly raises ``TypeError`` (:issue:`18850`)
587587
- Subtraction of :class:`Series` with timezone-aware ``dtype='datetime64[ns]'`` with mis-matched timezones will raise ``TypeError`` instead of ``ValueError`` (:issue:`18817`)
588588
- :func:`pandas.merge` provides a more informative error message when trying to merge on timezone-aware and timezone-naive columns (:issue:`15800`)
589-
- For :class:`DatetimeIndex` and :class:`TimedeltaIndex` with ``freq=None``, addition or subtraction of integer-dtyped array or ``Index`` will raise ``NullFrequencyError`` instead of ``TypeError`` (:issue:`19895`)
589+
- For :class:`DatetimeIndex` and :class:`TimedeltaIndex` with ``freq=None``, addition or subtraction of integer-dtyped array or ``Index`` will raise ``NullFrequencyError`` instead of ``TypeError`` if the index ``freq`` attribute is ``None``, and will return an object of the same class otherwise (:issue:`19895`, :issue:`19959`)
590590

591591
.. _whatsnew_0230.api.other:
592592

pandas/tests/indexes/datetimes/test_arithmetic.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ def test_dti_isub_int(self, tz, one):
361361
@pytest.mark.parametrize('freq', ['H', 'D'])
362362
@pytest.mark.parametrize('box', [np.array, pd.Index])
363363
def test_dti_add_intarray_tick(self, box, freq):
364+
# GH#19959
364365
dti = pd.date_range('2016-01-01', periods=2, freq=freq)
365366
other = box([4, -1])
366367
expected = DatetimeIndex([dti[n] + other[n] for n in range(len(dti))])
@@ -372,6 +373,7 @@ def test_dti_add_intarray_tick(self, box, freq):
372373
@pytest.mark.parametrize('freq', ['W', 'M', 'MS', 'Q'])
373374
@pytest.mark.parametrize('box', [np.array, pd.Index])
374375
def test_dti_add_intarray_non_tick(self, box, freq):
376+
# GH#19959
375377
dti = pd.date_range('2016-01-01', periods=2, freq=freq)
376378
other = box([4, -1])
377379
expected = DatetimeIndex([dti[n] + other[n] for n in range(len(dti))])
@@ -384,6 +386,7 @@ def test_dti_add_intarray_non_tick(self, box, freq):
384386

385387
@pytest.mark.parametrize('box', [np.array, pd.Index])
386388
def test_dti_add_intarray_no_freq(self, box):
389+
# GH#19959
387390
dti = pd.DatetimeIndex(['2016-01-01', 'NaT', '2017-04-05 06:07:08'])
388391
other = box([9, 4, -1])
389392
with pytest.raises(NullFrequencyError):

pandas/tests/indexes/period/test_arithmetic.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,7 @@ def test_pi_sub_isub_offset(self):
443443
@pytest.mark.parametrize('box', [np.array, pd.Index])
444444
@pytest.mark.parametrize('op', [operator.add, ops.radd])
445445
def test_pi_add_intarray(self, box, op):
446+
# GH#19959
446447
pi = pd.PeriodIndex([pd.Period('2015Q1'), pd.Period('NaT')])
447448
other = box([4, -1])
448449
result = op(pi, other)
@@ -451,6 +452,7 @@ def test_pi_add_intarray(self, box, op):
451452

452453
@pytest.mark.parametrize('box', [np.array, pd.Index])
453454
def test_pi_sub_intarray(self, box):
455+
# GH#19959
454456
pi = pd.PeriodIndex([pd.Period('2015Q1'), pd.Period('NaT')])
455457
other = box([4, -1])
456458
result = pi - other

pandas/tests/indexes/timedeltas/test_arithmetic.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,7 @@ def test_tdi_isub_int(self, one):
535535

536536
@pytest.mark.parametrize('box', [np.array, pd.Index])
537537
def test_tdi_add_integer_array(self, box):
538+
# GH#19959
538539
rng = timedelta_range('1 days 09:00:00', freq='H', periods=3)
539540
other = box([4, 3, 2])
540541
expected = TimedeltaIndex(['1 day 13:00:00'] * 3)
@@ -545,6 +546,7 @@ def test_tdi_add_integer_array(self, box):
545546

546547
@pytest.mark.parametrize('box', [np.array, pd.Index])
547548
def test_tdi_sub_integer_array(self, box):
549+
# GH#19959
548550
rng = timedelta_range('9H', freq='H', periods=3)
549551
other = box([4, 3, 2])
550552
expected = TimedeltaIndex(['5H', '7H', '9H'])
@@ -555,6 +557,7 @@ def test_tdi_sub_integer_array(self, box):
555557

556558
@pytest.mark.parametrize('box', [np.array, pd.Index])
557559
def test_tdi_addsub_integer_array_no_freq(self, box):
560+
# GH#19959
558561
tdi = TimedeltaIndex(['1 Day', 'NaT', '3 Hours'])
559562
other = box([14, -1, 16])
560563
with pytest.raises(NullFrequencyError):

0 commit comments

Comments
 (0)