From 202031d6df1db71c0f7b4c0bfbadfa178ed65559 Mon Sep 17 00:00:00 2001 From: Alex Barros Date: Fri, 30 Dec 2022 08:50:28 -0300 Subject: [PATCH] fix: comparison alerts (#1229) * fix: compare fail if alerts are not in all reports --- src/pandas_profiling/compare_reports.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pandas_profiling/compare_reports.py b/src/pandas_profiling/compare_reports.py index 9433623a5..0aae0c628 100644 --- a/src/pandas_profiling/compare_reports.py +++ b/src/pandas_profiling/compare_reports.py @@ -221,17 +221,17 @@ def _apply_config(description: dict, config: Settings) -> dict: return description -def _is_alert_present(alert: Alert, alert_list: list) -> bool: - return any( - a.column_name == alert.column_name and a.alert_type == alert.alert_type - for a in alert_list - ) +def _is_alert_present(alert, alert_list): + for a in alert_list: + if a.column_name == alert.column_name and a.alert_type == alert.alert_type: + return True + return False def _create_placehoder_alerts(report_alerts: tuple) -> tuple: from copy import copy - fixed: list = [[] for _ in report_alerts] + fixed = [[] for _ in report_alerts] for idx, alerts in enumerate(report_alerts): for alert in alerts: fixed[idx].append(alert)