Fix dashboard stats: support flat sync_state.json format (no 'tables' wrapper)
BigQuery adapter writes table entries at top level, not nested under 'tables'. Detect flat format by checking if values contain 'rows' key.
This commit is contained in:
parent
b3ba65be59
commit
85c07732b2
1 changed files with 3 additions and 0 deletions
|
|
@ -234,6 +234,9 @@ def _load_data_stats() -> dict:
|
|||
state = json.load(f)
|
||||
|
||||
tables_data = state.get("tables", {})
|
||||
# Support flat format (table_id at top level, no "tables" wrapper)
|
||||
if not tables_data and any(isinstance(v, dict) and "rows" in v for v in state.values()):
|
||||
tables_data = {k: v for k, v in state.items() if isinstance(v, dict) and "rows" in v}
|
||||
if not tables_data:
|
||||
return dict(FALLBACK_DATA_STATS)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue