|
14 | 14 | # ========================= |
15 | 15 | # Sidebar title |
16 | 16 | # ========================= |
17 | | -# Sidebar title (above nav via CSS) |
18 | | -# ========================= |
19 | 17 | st.markdown( |
20 | 18 | """ |
21 | 19 | <style> |
@@ -135,10 +133,10 @@ def load_gdelt_data() -> pd.DataFrame: |
135 | 133 | event_count, |
136 | 134 | avg_goldstein, |
137 | 135 | avg_tone, |
138 | | - verbal_cooperation_count, |
139 | | - material_cooperation_count, |
140 | | - verbal_conflict_count, |
141 | | - material_conflict_count |
| 136 | + quadclass_1_count AS verbal_cooperation_count, |
| 137 | + quadclass_2_count AS material_cooperation_count, |
| 138 | + quadclass_3_count AS verbal_conflict_count, |
| 139 | + quadclass_4_count AS material_conflict_count |
142 | 140 | FROM `{GDELT_TABLE_ID}` |
143 | 141 | ORDER BY week |
144 | 142 | """ |
@@ -223,7 +221,10 @@ def build_anomaly_table(merged_df: pd.DataFrame, top_n: int) -> pd.DataFrame: |
223 | 221 | st.stop() |
224 | 222 |
|
225 | 223 | if weekly_gdelt.empty: |
226 | | - st.error("No GDELT event data found in BigQuery.") |
| 224 | + st.error( |
| 225 | + "No GDELT event data found in BigQuery. Please rebuild the " |
| 226 | + "`weekly_gdelt_events` table with data first." |
| 227 | + ) |
227 | 228 | st.stop() |
228 | 229 |
|
229 | 230 | weekly_wti = weekly_wti.sort_values("week").copy() |
@@ -465,7 +466,6 @@ def build_anomaly_table(merged_df: pd.DataFrame, top_n: int) -> pd.DataFrame: |
465 | 466 |
|
466 | 467 | display_table = anomaly_table.copy() |
467 | 468 | display_table["week"] = display_table["week"].dt.strftime("%Y-%m-%d") |
468 | | - |
469 | 469 | st.dataframe(display_table, width="stretch") |
470 | 470 |
|
471 | 471 | with st.expander("Show merged weekly data"): |
|
0 commit comments