Skip to content

Commit

Permalink
fix: Saveguard against invalid comparison in pandas comparator (#8)
Browse files Browse the repository at this point in the history
* saveguard against invalid comparison in pandas comparator

* hooks
  • Loading branch information
DominikZuercherQC authored Oct 31, 2024
1 parent 326fe0b commit 08a5733
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tabulardelta/comparators/pandas_comparator.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,9 @@ def compare_pandas(
left, right, float_rtol, float_atol, True
)
else:
joined[col + "_equal"] = (left == right) | pd.isna(left) & pd.isna(right)
joined[col + "_equal"] = (left == right).fillna(False) | pd.isna(
left
) & pd.isna(right)
unequal = joined[~joined[col + "_equal"].astype("bool")]
change = _value_change(unequal, join_columns, col, suffixes, old_dt, new_dt)
if len(change) > 0:
Expand Down

0 comments on commit 08a5733

Please sign in to comment.