From 518b3aa30d4d054b1963eab4973446b0f7f5d453 Mon Sep 17 00:00:00 2001 From: Monson Shao Date: Mon, 23 Jul 2018 11:16:31 +0800 Subject: [PATCH] add GH num to xfer --- doc/source/whatsnew/v0.24.0.txt | 2 +- pandas/tests/frame/test_arithmetic.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/source/whatsnew/v0.24.0.txt b/doc/source/whatsnew/v0.24.0.txt index ecdf91fe4ebb3..52503f06c7e5c 100644 --- a/doc/source/whatsnew/v0.24.0.txt +++ b/doc/source/whatsnew/v0.24.0.txt @@ -443,7 +443,7 @@ Datetimelike Timedelta ^^^^^^^^^ -- Bug in :class:`DataFrame` with ``dtype='datetime64[ns]'`` when adding :class:`Timedelta` (:issue:`22007`) +- Bug in :class:`DataFrame` with ``dtype='datetime64[ns]'`` when adding :class:`Timedelta` (:issue:`22005`) - - diff --git a/pandas/tests/frame/test_arithmetic.py b/pandas/tests/frame/test_arithmetic.py index 3cdbf2ae608ac..60951b30ffa10 100644 --- a/pandas/tests/frame/test_arithmetic.py +++ b/pandas/tests/frame/test_arithmetic.py @@ -219,10 +219,14 @@ def test_df_sub_datetime64_not_ns(self): np.timedelta64(1, 'D') ]) def test_timestamp_df_add_timedelta(self, other): + # GH 22005 expected = pd.DataFrame([pd.Timestamp('2018-01-02')]) result = pd.DataFrame([pd.Timestamp('2018-01-01')]) + other tm.assert_frame_equal(result, expected) + result = pd.DataFrame([pd.Timestamp('2018-01-03')]) - other + tm.assert_frame_equal(result, expected) + result = other + pd.DataFrame([pd.Timestamp('2018-01-01')]) tm.assert_frame_equal(result, expected)