Skip to content

Commit

Permalink
fix: comparison alerts (ydataai#1229)
Browse files Browse the repository at this point in the history
* fix: compare fail if alerts are not in all reports
  • Loading branch information
alexbarros authored and Sohaib90 committed Jan 20, 2023
1 parent 3bd9565 commit 202031d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/pandas_profiling/compare_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 202031d

Please sign in to comment.