File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -1105,6 +1105,37 @@ def assert_series_equal(
11051105 index_values = left .index ,
11061106 obj = str (obj ),
11071107 )
1108+ elif not check_dtype :
1109+ # When dtype checks are off, treat all missing sentinels as equal.
1110+ left_na = np .asarray (left .isna ())
1111+ right_na = np .asarray (right .isna ())
1112+ assert_numpy_array_equal (
1113+ left_na , right_na , obj = f"{ obj } NA mask" , index_values = left .index
1114+ )
1115+
1116+ left_valid = left [~ left_na ].to_numpy (dtype = object )
1117+ right_valid = right [~ right_na ].to_numpy (dtype = object )
1118+
1119+ _testing .assert_almost_equal (
1120+ left_valid ,
1121+ right_valid ,
1122+ check_dtype = False ,
1123+ rtol = rtol ,
1124+ atol = atol ,
1125+ obj = str (obj ),
1126+ index_values = left .index ,
1127+ )
1128+ return
1129+ else :
1130+ _testing .assert_almost_equal (
1131+ left ._values ,
1132+ right ._values ,
1133+ rtol = rtol ,
1134+ atol = atol ,
1135+ check_dtype = bool (check_dtype ),
1136+ obj = str (obj ),
1137+ index_values = left .index ,
1138+ )
11081139 else :
11091140 _testing .assert_almost_equal (
11101141 left ._values ,
You can’t perform that action at this time.
0 commit comments