File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -1316,6 +1316,20 @@ def assert_frame_equal(
1316
1316
lcol = left ._ixs (i , axis = 1 )
1317
1317
rcol = right ._ixs (i , axis = 1 )
1318
1318
1319
+ # Fix for issue #61473: Handle pd.NA values when check_dtype=False
1320
+ if not check_dtype :
1321
+ # Normalize both pd.NA and np.nan to the same representation for comparison
1322
+ # This allows comparison between object and Int32 dtypes with pd.NA
1323
+ lcol_normalized = lcol .copy ()
1324
+ rcol_normalized = rcol .copy ()
1325
+
1326
+ # Replace all null values (pd.NA, np.nan) with a consistent representation
1327
+ lcol_normalized = lcol_normalized .where (lcol_normalized .notna (), np .nan )
1328
+ rcol_normalized = rcol_normalized .where (rcol_normalized .notna (), np .nan )
1329
+
1330
+ lcol = lcol_normalized
1331
+ rcol = rcol_normalized
1332
+
1319
1333
# GH #38183
1320
1334
# use check_index=False, because we do not want to run
1321
1335
# assert_index_equal for each column,
You can’t perform that action at this time.
0 commit comments