diff --git a/src/pages/observatoire.py b/src/pages/observatoire.py index 4fae0c7..e58c9ba 100644 --- a/src/pages/observatoire.py +++ b/src/pages/observatoire.py @@ -508,17 +508,26 @@ Alors, on fait comment ? size="xl", ), # DataTable - html.Div( - className="marches_table", - children=DataTable( - dtid="observatoire-preview-table", - page_size=5, - page_action="custom", - sort_action="custom", - filter_action="custom", - hidden_columns=[], - columns=[{"id": col, "name": col} for col in OBSERVATOIRE_COLUMNS], - ), + dcc.Loading( + overlay_style={"visibility": "visible", "filter": "blur(2px)"}, + id="loading-statistques", + type="default", + children=[ + html.Div( + className="marches_table", + children=DataTable( + dtid="observatoire-preview-table", + page_size=5, + page_action="custom", + sort_action="custom", + filter_action="custom", + hidden_columns=[], + columns=[ + {"id": col, "name": col} for col in OBSERVATOIRE_COLUMNS + ], + ), + ) + ], ), ], ), diff --git a/tests/test_prepare_dashboard_data.py b/tests/test_prepare_dashboard_data.py deleted file mode 100644 index 369a299..0000000 --- a/tests/test_prepare_dashboard_data.py +++ /dev/null @@ -1,47 +0,0 @@ -import polars as pl - - -def test_returns_dataframe_with_year_filter(): - from src.utils.data import prepare_dashboard_data - - dff = prepare_dashboard_data(dashboard_year="2025") - assert isinstance(dff, pl.DataFrame) - assert dff.height == 1 - - -def test_year_mismatch_returns_empty(): - from src.utils.data import prepare_dashboard_data - - dff = prepare_dashboard_data(dashboard_year="2024") - assert isinstance(dff, pl.DataFrame) - assert dff.height == 0 - - -def test_acheteur_id_partial_match(): - from src.utils.data import prepare_dashboard_data - - dff = prepare_dashboard_data( - dashboard_year="2025", - dashboard_acheteur_id="12", - ) - assert dff.height == 1 - - -def test_departement_in_clause(): - from src.utils.data import prepare_dashboard_data - - dff = prepare_dashboard_data( - dashboard_year="2025", - dashboard_acheteur_departement_code=["75", "92"], - ) - assert dff.height == 1 - - -def test_montant_min_above_value_excludes_row(): - from src.utils.data import prepare_dashboard_data - - dff = prepare_dashboard_data( - dashboard_year="2025", - dashboard_montant_min=1000, - ) - assert dff.height == 0