@@ -328,40 +328,40 @@ def test_dt64arr_timestamp_equality(self, box_with_array):
328
328
box_with_array if box_with_array not in [pd .Index , pd .array ] else np .ndarray
329
329
)
330
330
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" ])
332
332
ser = tm .box_expected (ser , box_with_array )
333
333
334
334
result = ser != ser
335
- expected = tm .box_expected ([False , True ], xbox )
335
+ expected = tm .box_expected ([False , False , True ], xbox )
336
336
tm .assert_equal (result , expected )
337
337
338
338
warn = FutureWarning if box_with_array is pd .DataFrame else None
339
339
with tm .assert_produces_warning (warn ):
340
340
# alignment for frame vs series comparisons deprecated
341
341
result = ser != ser [0 ]
342
- expected = tm .box_expected ([False , True ], xbox )
342
+ expected = tm .box_expected ([False , True , True ], xbox )
343
343
tm .assert_equal (result , expected )
344
344
345
345
with tm .assert_produces_warning (warn ):
346
346
# 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 )
349
349
tm .assert_equal (result , expected )
350
350
351
351
result = ser == ser
352
- expected = tm .box_expected ([True , False ], xbox )
352
+ expected = tm .box_expected ([True , True , False ], xbox )
353
353
tm .assert_equal (result , expected )
354
354
355
355
with tm .assert_produces_warning (warn ):
356
356
# alignment for frame vs series comparisons deprecated
357
357
result = ser == ser [0 ]
358
- expected = tm .box_expected ([True , False ], xbox )
358
+ expected = tm .box_expected ([True , False , False ], xbox )
359
359
tm .assert_equal (result , expected )
360
360
361
361
with tm .assert_produces_warning (warn ):
362
362
# 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 )
365
365
tm .assert_equal (result , expected )
366
366
367
367
@@ -1020,10 +1020,7 @@ def test_dt64arr_sub_dt64object_array(self, box_with_array, tz_naive_fixture):
1020
1020
obj = tm .box_expected (dti , box_with_array )
1021
1021
expected = tm .box_expected (expected , box_with_array )
1022
1022
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 ):
1027
1024
result = obj - obj .astype (object )
1028
1025
tm .assert_equal (result , expected )
1029
1026
@@ -1286,7 +1283,7 @@ def test_dt64arr_add_sub_relativedelta_offsets(self, box_with_array):
1286
1283
]
1287
1284
)
1288
1285
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
1290
1287
1291
1288
# DateOffset relativedelta fastpath
1292
1289
relative_kwargs = [
@@ -1411,7 +1408,7 @@ def test_dt64arr_add_sub_DateOffsets(
1411
1408
]
1412
1409
)
1413
1410
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
1415
1412
1416
1413
offset_cls = getattr (pd .offsets , cls_name )
1417
1414
@@ -1525,10 +1522,7 @@ def test_dt64arr_add_sub_offset_array(
1525
1522
if box_other :
1526
1523
other = tm .box_expected (other , box_with_array )
1527
1524
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 ):
1532
1526
res = op (dtarr , other )
1533
1527
1534
1528
tm .assert_equal (res , expected )
@@ -2469,18 +2463,14 @@ def test_dti_addsub_object_arraylike(
2469
2463
expected = DatetimeIndex (["2017-01-31" , "2017-01-06" ], tz = tz_naive_fixture )
2470
2464
expected = tm .box_expected (expected , xbox )
2471
2465
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 ):
2477
2467
result = dtarr + other
2478
2468
tm .assert_equal (result , expected )
2479
2469
2480
2470
expected = DatetimeIndex (["2016-12-31" , "2016-12-29" ], tz = tz_naive_fixture )
2481
2471
expected = tm .box_expected (expected , xbox )
2482
2472
2483
- with tm .assert_produces_warning (warn ):
2473
+ with tm .assert_produces_warning (PerformanceWarning ):
2484
2474
result = dtarr - other
2485
2475
tm .assert_equal (result , expected )
2486
2476
0 commit comments