@@ -1289,7 +1289,6 @@ def assert_series_equal(
1289
1289
rtol = 1.0e-5 ,
1290
1290
atol = 1.0e-8 ,
1291
1291
obj = "Series" ,
1292
- check_index = True ,
1293
1292
):
1294
1293
"""
1295
1294
Check that left and right Series are equal.
@@ -1363,6 +1362,57 @@ def assert_series_equal(
1363
1362
"""
1364
1363
__tracebackhide__ = True
1365
1364
1365
+ _assert_series_values_equal (
1366
+ left ,
1367
+ right ,
1368
+ check_dtype = check_dtype ,
1369
+ check_index_type = check_index_type ,
1370
+ check_series_type = check_series_type ,
1371
+ check_less_precise = check_less_precise ,
1372
+ check_names = check_names ,
1373
+ check_exact = check_exact ,
1374
+ check_datetimelike_compat = check_datetimelike_compat ,
1375
+ check_categorical = check_categorical ,
1376
+ check_category_order = check_category_order ,
1377
+ check_freq = check_freq ,
1378
+ check_flags = check_flags ,
1379
+ rtol = rtol ,
1380
+ atol = atol ,
1381
+ obj = obj ,
1382
+ )
1383
+
1384
+ assert_index_equal (
1385
+ left .index ,
1386
+ right .index ,
1387
+ exact = check_index_type ,
1388
+ check_names = check_names ,
1389
+ check_exact = check_exact ,
1390
+ check_categorical = check_categorical ,
1391
+ rtol = rtol ,
1392
+ atol = atol ,
1393
+ obj = f"{ obj } .index" ,
1394
+ )
1395
+
1396
+
1397
+ def _assert_series_values_equal (
1398
+ left ,
1399
+ right ,
1400
+ * ,
1401
+ check_dtype = True ,
1402
+ check_index_type = "equiv" ,
1403
+ check_series_type = True ,
1404
+ check_less_precise = no_default ,
1405
+ check_names = True ,
1406
+ check_exact = False ,
1407
+ check_datetimelike_compat = False ,
1408
+ check_categorical = True ,
1409
+ check_category_order = True ,
1410
+ check_freq = True ,
1411
+ check_flags = True ,
1412
+ rtol = 1.0e-5 ,
1413
+ atol = 1.0e-8 ,
1414
+ obj = "Series" ,
1415
+ ):
1366
1416
if check_less_precise is not no_default :
1367
1417
warnings .warn (
1368
1418
"The 'check_less_precise' keyword in testing.assert_*_equal "
@@ -1388,20 +1438,6 @@ def assert_series_equal(
1388
1438
if check_flags :
1389
1439
assert left .flags == right .flags , f"{ repr (left .flags )} != { repr (right .flags )} "
1390
1440
1391
- if check_index :
1392
- # GH #38183
1393
- assert_index_equal (
1394
- left .index ,
1395
- right .index ,
1396
- exact = check_index_type ,
1397
- check_names = check_names ,
1398
- check_exact = check_exact ,
1399
- check_categorical = check_categorical ,
1400
- rtol = rtol ,
1401
- atol = atol ,
1402
- obj = f"{ obj } .index" ,
1403
- )
1404
-
1405
1441
if check_freq and isinstance (left .index , (pd .DatetimeIndex , pd .TimedeltaIndex )):
1406
1442
lidx = left .index
1407
1443
ridx = right .index
@@ -1697,7 +1733,7 @@ def assert_frame_equal(
1697
1733
assert col in right
1698
1734
lcol = left .iloc [:, i ]
1699
1735
rcol = right .iloc [:, i ]
1700
- assert_series_equal (
1736
+ _assert_series_values_equal (
1701
1737
lcol ,
1702
1738
rcol ,
1703
1739
check_dtype = check_dtype ,
@@ -1710,7 +1746,6 @@ def assert_frame_equal(
1710
1746
obj = f'{ obj } .iloc[:, { i } ] (column name="{ col } ")' ,
1711
1747
rtol = rtol ,
1712
1748
atol = atol ,
1713
- check_index = False ,
1714
1749
)
1715
1750
1716
1751
0 commit comments