Skip to content

Commit b13b851

Browse files
author
Justine Wezenaar
committed
wip replicating issue
1 parent b20d6ab commit b13b851

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

pandas/core/dtypes/missing.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,7 @@ def _array_equivalent_object(
524524
elif isinstance(left_value, float) and np.isnan(left_value):
525525
if not isinstance(right_value, float) or not np.isnan(right_value):
526526
return False
527+
527528
else:
528529
with warnings.catch_warnings():
529530
# suppress numpy's "elementwise comparison failed"

pandas/tests/util/test_assert_frame_equal.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,3 +413,12 @@ def test_datetimelike_compat_deprecated():
413413
tm.assert_series_equal(df["a"], df["a"], check_datetimelike_compat=True)
414414
with tm.assert_produces_warning(Pandas4Warning, match=msg):
415415
tm.assert_series_equal(df["a"], df["a"], check_datetimelike_compat=False)
416+
417+
418+
def test_assert_frame_equal_nested_df_na():
419+
# GH#43022
420+
inner = DataFrame({"a": [1, float("nan")]})
421+
df1 = DataFrame({"df": [inner]})
422+
df2 = DataFrame({"df": [inner]})
423+
424+
tm.assert_frame_equal(df1, df2)

0 commit comments

Comments
 (0)