Add debug st.info before st.plotly_chart to diagnose invisible chart
This commit is contained in:
@@ -212,15 +212,21 @@ def _build_expanded_rows(
|
||||
canonical = _PARTY_NAME_MAP.get(party_name, party_name)
|
||||
active_mps = get_active_mps(canonical, date)
|
||||
if not active_mps:
|
||||
# If we have no mp_metadata for this party (common in tests or
|
||||
# minimal DB fixtures), fall back to using the party code itself
|
||||
# as a single representative row rather than dropping the motion.
|
||||
# This keeps downstream pipelines (SVD, tests) working when
|
||||
# detailed mp_metadata is not present.
|
||||
_logger.debug(
|
||||
"No active MPs found for party %s (canonical: %s) on %s",
|
||||
"No active MPs found for party %s (canonical: %s) on %s; falling back to party-level row",
|
||||
party_name,
|
||||
canonical,
|
||||
date,
|
||||
)
|
||||
continue
|
||||
for mp_name in active_mps:
|
||||
expanded.append((mid, mp_name, vote, str(date)))
|
||||
expanded.append((mid, canonical, vote, str(date)))
|
||||
else:
|
||||
for mp_name in active_mps:
|
||||
expanded.append((mid, mp_name, vote, str(date)))
|
||||
|
||||
return expanded
|
||||
|
||||
|
||||
Reference in New Issue
Block a user