Skip to content

Commit 08a5733

Browse files
fix: Saveguard against invalid comparison in pandas comparator (#8)
* saveguard against invalid comparison in pandas comparator * hooks
1 parent 326fe0b commit 08a5733

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tabulardelta/comparators/pandas_comparator.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,9 @@ def compare_pandas(
290290
left, right, float_rtol, float_atol, True
291291
)
292292
else:
293-
joined[col + "_equal"] = (left == right) | pd.isna(left) & pd.isna(right)
293+
joined[col + "_equal"] = (left == right).fillna(False) | pd.isna(
294+
left
295+
) & pd.isna(right)
294296
unequal = joined[~joined[col + "_equal"].astype("bool")]
295297
change = _value_change(unequal, join_columns, col, suffixes, old_dt, new_dt)
296298
if len(change) > 0:

0 commit comments

Comments
 (0)