From 0ec208562895ce7b1e004f7c91c9186bdc547ef0 Mon Sep 17 00:00:00 2001 From: Azory YData Bot Date: Mon, 8 Jul 2024 22:19:37 +0000 Subject: [PATCH] fix(linting): code formatting --- src/ydata_profiling/expectations_report.py | 4 +--- src/ydata_profiling/utils/logger.py | 4 ++-- src/ydata_profiling/visualisation/plot.py | 6 +++++- tests/unit/test_ge_integration.py | 4 +--- tests/unit/test_plot.py | 1 - 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/ydata_profiling/expectations_report.py b/src/ydata_profiling/expectations_report.py index ca5b242ec..a4f32e2a3 100644 --- a/src/ydata_profiling/expectations_report.py +++ b/src/ydata_profiling/expectations_report.py @@ -79,9 +79,7 @@ def to_expectation_suite( if not data_context: data_context = ge.data_context.DataContext() - suite = data_context.add_expectation_suite( - suite_name - ) + suite = data_context.add_expectation_suite(suite_name) # Instantiate an in-memory pandas dataset batch = ge.dataset.PandasDataset(self.df, expectation_suite=suite) diff --git a/src/ydata_profiling/utils/logger.py b/src/ydata_profiling/utils/logger.py index 473871ca9..c7e489032 100644 --- a/src/ydata_profiling/utils/logger.py +++ b/src/ydata_profiling/utils/logger.py @@ -10,10 +10,10 @@ class ProfilingLogger(logging.Logger): - def __init__(self, name: str, level: int =logging.INFO): + def __init__(self, name: str, level: int = logging.INFO): super().__init__(name, level) - def info_def_report(self, dataframe, timeseries: bool) -> None: # type: ignore + def info_def_report(self, dataframe, timeseries: bool) -> None: # type: ignore if dataframe is pd.DataFrame: dataframe = "pandas" report_type = "regular" diff --git a/src/ydata_profiling/visualisation/plot.py b/src/ydata_profiling/visualisation/plot.py index f6942bb3c..be2286c58 100644 --- a/src/ydata_profiling/visualisation/plot.py +++ b/src/ydata_profiling/visualisation/plot.py @@ -839,7 +839,11 @@ def _prepare_heatmap_data( ) df = df.groupby([entity_column, "__bins"])[sortbykey].count() - df = df.reset_index().pivot_table(values=sortbykey, index="__bins", columns=entity_column).T + df = ( + df.reset_index() + .pivot_table(values=sortbykey, index="__bins", columns=entity_column) + .T + ) if selected_entities: df = df[selected_entities] diff --git a/tests/unit/test_ge_integration.py b/tests/unit/test_ge_integration.py index 8920e3255..80d7329f9 100644 --- a/tests/unit/test_ge_integration.py +++ b/tests/unit/test_ge_integration.py @@ -92,9 +92,7 @@ def test_to_expectations_suite_title(context, df): run_validation=False, ) - context.add_expectation_suite.assert_called_once_with( - "expectations-dataset" - ) + context.add_expectation_suite.assert_called_once_with("expectations-dataset") def test_to_expectation_suite_no_context(mod, df): diff --git a/tests/unit/test_plot.py b/tests/unit/test_plot.py index 2b6d739d3..07b74cbd7 100644 --- a/tests/unit/test_plot.py +++ b/tests/unit/test_plot.py @@ -97,4 +97,3 @@ def test_timeseries_heatmap(dataframe: pd.DataFrame): df = _prepare_heatmap_data(dataframe, "entity") plot = _create_timeseries_heatmap(df) assert isinstance(plot, Axes) -