Skip to content

Commit 938a601

Browse files
azory-ydataportellaa
authored andcommitted
fix(linting): code formatting
1 parent e4814fd commit 938a601

5 files changed

Lines changed: 15 additions & 15 deletions

File tree

src/ydata_profiling/model/alerts.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,16 +120,18 @@ def anchor_id(self) -> Optional[str]:
120120

121121
def fmt(self) -> str:
122122
# TODO: render in template
123-
style = self._styles.get(self.alert_type.name.lower(), 'secondary')
124-
hint = ''
123+
style = self._styles.get(self.alert_type.name.lower(), "secondary")
124+
hint = ""
125125

126126
if self.alert_type == AlertType.HIGH_CORRELATION and self.values is not None:
127127
num = len(self.values["fields"])
128128
title = ", ".join(self.values["fields"])
129129
corr = self.values["corr"]
130130
hint = f'data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="This variable has a high {corr} correlation with {num} fields: {title}"'
131131

132-
return f'<span class="badge text-bg-{style}" {hint}>{self.alert_type_name}</span>'
132+
return (
133+
f'<span class="badge text-bg-{style}" {hint}>{self.alert_type_name}</span>'
134+
)
133135

134136
def _get_description(self) -> str:
135137
"""Return a human level description of the alert.

src/ydata_profiling/profile_report.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,7 @@ def __init__(
139139
if len(kwargs) > 0:
140140
shorthands, kwargs = Config.shorthands(kwargs)
141141
report_config = report_config.update(
142-
Settings()
143-
.update(shorthands)
144-
.dict(exclude_defaults=True)
142+
Settings().update(shorthands).dict(exclude_defaults=True)
145143
)
146144

147145
if kwargs:

src/ydata_profiling/report/formatters.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,4 +336,8 @@ def help(title: str, url: Optional[str] = None) -> str:
336336

337337
@list_args
338338
def fmt_badge(value: str) -> str:
339-
return re.sub(r"\((\d+)\)", r'<span class="badge text-bg-secondary align-text-top">\1</span>', value)
339+
return re.sub(
340+
r"\((\d+)\)",
341+
r'<span class="badge text-bg-secondary align-text-top">\1</span>',
342+
value,
343+
)

src/ydata_profiling/report/presentation/flavours/widget/alerts.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ def render(self) -> widgets.GridBox:
3131
)
3232

3333
style_name = styles[type_name]
34-
if style_name not in ('primary', 'success', 'info', 'warning', 'danger'):
35-
style_name = ''
34+
if style_name not in ("primary", "success", "info", "warning", "danger"):
35+
style_name = ""
3636

3737
items.append(
3838
Button(

tests/unit/test_time_series.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,14 @@ def test_timeseries_identification(html_profile: str):
4343

4444

4545
def test_timeseries_autocorrelation_tab(html_profile: str):
46-
assert (
47-
">Autocorrelation<" in html_profile
48-
), "TimeSeries not detected"
46+
assert ">Autocorrelation<" in html_profile, "TimeSeries not detected"
4947
assert (
5048
html_profile.count(">Autocorrelation<") == 8
5149
), "TimeSeries autocorrelation tabs incorrectly generated"
5250

5351

5452
def test_timeseries_seasonality(html_profile: str):
55-
assert (
56-
">Seasonal<" in html_profile
57-
), "Seasonality incorrectly identified"
53+
assert ">Seasonal<" in html_profile, "Seasonality incorrectly identified"
5854
assert (
5955
html_profile.count(">Seasonal<") == 4
6056
), "Seasonality warning incorrectly identified"

0 commit comments

Comments
 (0)