From 2527c5f4d9a8706a195eb8be2b1af2ec731ba0d6 Mon Sep 17 00:00:00 2001 From: DominikZuercherQC Date: Thu, 31 Oct 2024 10:05:39 +0100 Subject: [PATCH] saveguard against invalid comparison in pandas comparator --- tabulardelta/comparators/pandas_comparator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tabulardelta/comparators/pandas_comparator.py b/tabulardelta/comparators/pandas_comparator.py index bbbe26d..9a63a8e 100644 --- a/tabulardelta/comparators/pandas_comparator.py +++ b/tabulardelta/comparators/pandas_comparator.py @@ -290,7 +290,7 @@ 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: