Skip to content

Commit 34431a1

Browse files
alexbarrosaquemy
authored andcommitted
fix: comparison report style issues
1 parent 37cd822 commit 34431a1

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/pandas_profiling/compare_reports.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import pandas as pd
55

66
from pandas_profiling.config import Correlation, Settings
7+
from pandas_profiling.model.alerts import Alert
78
from pandas_profiling.profile_report import ProfileReport
89

910

@@ -220,17 +221,17 @@ def _apply_config(description: dict, config: Settings) -> dict:
220221
return description
221222

222223

223-
def _is_alert_present(alert, alert_list):
224-
for a in alert_list:
225-
if a.column_name == alert.column_name and a.alert_type == alert.alert_type:
226-
return True
227-
return False
224+
def _is_alert_present(alert: Alert, alert_list: list) -> bool:
225+
return any(
226+
a.column_name == alert.column_name and a.alert_type == alert.alert_type
227+
for a in alert_list
228+
)
228229

229230

230231
def _create_placehoder_alerts(report_alerts: tuple) -> tuple:
231232
from copy import copy
232233

233-
fixed = [[] for _ in report_alerts]
234+
fixed: list = [[] for _ in report_alerts]
234235
for idx, alerts in enumerate(report_alerts):
235236
for alert in alerts:
236237
fixed[idx].append(alert)

0 commit comments

Comments
 (0)