jaimalklyde commited on
Commit
2c2949e
·
verified ·
1 Parent(s): 8382062

Update src/module/Indicateurs_DQ.py

Browse files
Files changed (1) hide show
  1. src/module/Indicateurs_DQ.py +7 -7
src/module/Indicateurs_DQ.py CHANGED
@@ -56,10 +56,13 @@ def show_dq_dashboard(client, sheet_name):
56
 
57
  if 'data_explorer' not in st.session_state or not st.session_state.data_explorer.dataframes:
58
  st.info("Chargement des données pour Audit...")
59
- success, data = etl.run_etl()
60
  if not success:
61
- st.error(f"Erreur chargement : {data}")
62
  return
 
 
 
63
  else:
64
  data = st.session_state.data_explorer.dataframes
65
 
@@ -72,11 +75,8 @@ def show_dq_dashboard(client, sheet_name):
72
  # ================= NORMALISATION DQ ================
73
  for df in [df_pat, df_sej, df_res, df_stock]:
74
  if df is not None and 'dq_is_anomaly' in df.columns:
75
- df['dq_is_anomaly'] = (
76
- pd.to_numeric(df['dq_is_anomaly'], errors='coerce')
77
- .fillna(0)
78
- .astype(int)
79
- )
80
 
81
  # ==================================================
82
  # ================= KPI GLOBAUX ====================
 
56
 
57
  if 'data_explorer' not in st.session_state or not st.session_state.data_explorer.dataframes:
58
  st.info("Chargement des données pour Audit...")
59
+ success, data_explorer = etl.run_etl()
60
  if not success:
61
+ st.error(f"Erreur chargement : {data_explorer}")
62
  return
63
+
64
+ data = data_explorer.dataframes
65
+
66
  else:
67
  data = st.session_state.data_explorer.dataframes
68
 
 
75
  # ================= NORMALISATION DQ ================
76
  for df in [df_pat, df_sej, df_res, df_stock]:
77
  if df is not None and 'dq_is_anomaly' in df.columns:
78
+ df['dq_is_anomaly'] = (df['dq_is_anomaly'] == 1).astype(int)
79
+
 
 
 
80
 
81
  # ==================================================
82
  # ================= KPI GLOBAUX ====================