Skip to content

Commit

Permalink
Fix pd.NaT - Series (#19251)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrockmendel authored and jreback committed Jan 16, 2018
1 parent c271d4d commit 4ebdc50
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions doc/source/whatsnew/v0.23.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -423,10 +423,10 @@ Conversion
- Bug in :class:`WeekOfMonth` and :class:`LastWeekOfMonth` where default keyword arguments for constructor raised ``ValueError`` (:issue:`19142`)
- Bug in localization of a naive, datetime string in a ``Series`` constructor with a ``datetime64[ns, tz]`` dtype (:issue:`174151`)
- :func:`Timestamp.replace` will now handle Daylight Savings transitions gracefully (:issue:`18319`)



-
-
- Bug in ``.astype()`` to non-ns timedelta units would hold the incorrect dtype (:issue:`19176`, :issue:`19223`, :issue:`12425`)
- Bug in subtracting :class:`Series` from ``NaT`` incorrectly returning ``NaT`` (:issue:`19158`)


Indexing
Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/tslibs/nattype.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ cdef class _NaT(datetime):
neg_other = -other
return self + neg_other

elif getattr(other, '_typ', None) in ['period',
elif getattr(other, '_typ', None) in ['period', 'series',
'periodindex', 'dateoffset']:
return NotImplemented

Expand Down
3 changes: 1 addition & 2 deletions pandas/tests/scalar/test_nat.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,7 @@ def test_nat_arithmetic_index():

@pytest.mark.parametrize('box, assert_func', [
(TimedeltaIndex, tm.assert_index_equal),
pytest.param(Series, tm.assert_series_equal,
marks=pytest.mark.xfail(reason='NaT - Series returns NaT'))
(Series, tm.assert_series_equal)
])
def test_nat_arithmetic_td64_vector(box, assert_func):
# GH#19124
Expand Down

0 comments on commit 4ebdc50

Please sign in to comment.