Spinner de chargemetn sur la préviusalisation des données

This commit is contained in:
Colin Maudry
2026-04-23 12:33:30 +02:00
parent a715140af0
commit fc4d965b20
2 changed files with 20 additions and 58 deletions
+20 -11
View File
@@ -508,17 +508,26 @@ Alors, on fait comment ?
size="xl", size="xl",
), ),
# DataTable # DataTable
html.Div( dcc.Loading(
className="marches_table", overlay_style={"visibility": "visible", "filter": "blur(2px)"},
children=DataTable( id="loading-statistques",
dtid="observatoire-preview-table", type="default",
page_size=5, children=[
page_action="custom", html.Div(
sort_action="custom", className="marches_table",
filter_action="custom", children=DataTable(
hidden_columns=[], dtid="observatoire-preview-table",
columns=[{"id": col, "name": col} for col in OBSERVATOIRE_COLUMNS], page_size=5,
), page_action="custom",
sort_action="custom",
filter_action="custom",
hidden_columns=[],
columns=[
{"id": col, "name": col} for col in OBSERVATOIRE_COLUMNS
],
),
)
],
), ),
], ],
), ),
-47
View File
@@ -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