@@ -328,40 +328,40 @@ def test_dt64arr_timestamp_equality(self, box_with_array):
328328 box_with_array if box_with_array not in [pd .Index , pd .array ] else np .ndarray
329329 )
330330
331- ser = Series ([Timestamp ("2000-01-29 01:59:00" ), "NaT" ])
331+ ser = Series ([Timestamp ("2000-01-29 01:59:00" ), Timestamp ( "2000-01-30" ), "NaT" ])
332332 ser = tm .box_expected (ser , box_with_array )
333333
334334 result = ser != ser
335- expected = tm .box_expected ([False , True ], xbox )
335+ expected = tm .box_expected ([False , False , True ], xbox )
336336 tm .assert_equal (result , expected )
337337
338338 warn = FutureWarning if box_with_array is pd .DataFrame else None
339339 with tm .assert_produces_warning (warn ):
340340 # alignment for frame vs series comparisons deprecated
341341 result = ser != ser [0 ]
342- expected = tm .box_expected ([False , True ], xbox )
342+ expected = tm .box_expected ([False , True , True ], xbox )
343343 tm .assert_equal (result , expected )
344344
345345 with tm .assert_produces_warning (warn ):
346346 # alignment for frame vs series comparisons deprecated
347- result = ser != ser [1 ]
348- expected = tm .box_expected ([True , True ], xbox )
347+ result = ser != ser [2 ]
348+ expected = tm .box_expected ([True , True , True ], xbox )
349349 tm .assert_equal (result , expected )
350350
351351 result = ser == ser
352- expected = tm .box_expected ([True , False ], xbox )
352+ expected = tm .box_expected ([True , True , False ], xbox )
353353 tm .assert_equal (result , expected )
354354
355355 with tm .assert_produces_warning (warn ):
356356 # alignment for frame vs series comparisons deprecated
357357 result = ser == ser [0 ]
358- expected = tm .box_expected ([True , False ], xbox )
358+ expected = tm .box_expected ([True , False , False ], xbox )
359359 tm .assert_equal (result , expected )
360360
361361 with tm .assert_produces_warning (warn ):
362362 # alignment for frame vs series comparisons deprecated
363- result = ser == ser [1 ]
364- expected = tm .box_expected ([False , False ], xbox )
363+ result = ser == ser [2 ]
364+ expected = tm .box_expected ([False , False , False ], xbox )
365365 tm .assert_equal (result , expected )
366366
367367
@@ -1020,10 +1020,7 @@ def test_dt64arr_sub_dt64object_array(self, box_with_array, tz_naive_fixture):
10201020 obj = tm .box_expected (dti , box_with_array )
10211021 expected = tm .box_expected (expected , box_with_array )
10221022
1023- warn = None
1024- if box_with_array is not pd .DataFrame or tz_naive_fixture is None :
1025- warn = PerformanceWarning
1026- with tm .assert_produces_warning (warn ):
1023+ with tm .assert_produces_warning (PerformanceWarning ):
10271024 result = obj - obj .astype (object )
10281025 tm .assert_equal (result , expected )
10291026
@@ -1286,7 +1283,7 @@ def test_dt64arr_add_sub_relativedelta_offsets(self, box_with_array):
12861283 ]
12871284 )
12881285 vec = tm .box_expected (vec , box_with_array )
1289- vec_items = vec .squeeze () if box_with_array is pd .DataFrame else vec
1286+ vec_items = vec .iloc [ 0 ] if box_with_array is pd .DataFrame else vec
12901287
12911288 # DateOffset relativedelta fastpath
12921289 relative_kwargs = [
@@ -1411,7 +1408,7 @@ def test_dt64arr_add_sub_DateOffsets(
14111408 ]
14121409 )
14131410 vec = tm .box_expected (vec , box_with_array )
1414- vec_items = vec .squeeze () if box_with_array is pd .DataFrame else vec
1411+ vec_items = vec .iloc [ 0 ] if box_with_array is pd .DataFrame else vec
14151412
14161413 offset_cls = getattr (pd .offsets , cls_name )
14171414
@@ -1525,10 +1522,7 @@ def test_dt64arr_add_sub_offset_array(
15251522 if box_other :
15261523 other = tm .box_expected (other , box_with_array )
15271524
1528- warn = PerformanceWarning
1529- if box_with_array is pd .DataFrame and tz is not None :
1530- warn = None
1531- with tm .assert_produces_warning (warn ):
1525+ with tm .assert_produces_warning (PerformanceWarning ):
15321526 res = op (dtarr , other )
15331527
15341528 tm .assert_equal (res , expected )
@@ -2469,18 +2463,14 @@ def test_dti_addsub_object_arraylike(
24692463 expected = DatetimeIndex (["2017-01-31" , "2017-01-06" ], tz = tz_naive_fixture )
24702464 expected = tm .box_expected (expected , xbox )
24712465
2472- warn = PerformanceWarning
2473- if box_with_array is pd .DataFrame and tz is not None :
2474- warn = None
2475-
2476- with tm .assert_produces_warning (warn ):
2466+ with tm .assert_produces_warning (PerformanceWarning ):
24772467 result = dtarr + other
24782468 tm .assert_equal (result , expected )
24792469
24802470 expected = DatetimeIndex (["2016-12-31" , "2016-12-29" ], tz = tz_naive_fixture )
24812471 expected = tm .box_expected (expected , xbox )
24822472
2483- with tm .assert_produces_warning (warn ):
2473+ with tm .assert_produces_warning (PerformanceWarning ):
24842474 result = dtarr - other
24852475 tm .assert_equal (result , expected )
24862476
0 commit comments