Skip to content

Commit 13955d8

Browse files
authored
Merge pull request #55 from advanced-computing/bug_fix
fix bugs on page 3
2 parents b8fbe2e + 2e528ab commit 13955d8

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

pages/3_Event_Context.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
# =========================
1515
# Sidebar title
1616
# =========================
17-
# Sidebar title (above nav via CSS)
18-
# =========================
1917
st.markdown(
2018
"""
2119
<style>
@@ -135,10 +133,10 @@ def load_gdelt_data() -> pd.DataFrame:
135133
event_count,
136134
avg_goldstein,
137135
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
142140
FROM `{GDELT_TABLE_ID}`
143141
ORDER BY week
144142
"""
@@ -223,7 +221,10 @@ def build_anomaly_table(merged_df: pd.DataFrame, top_n: int) -> pd.DataFrame:
223221
st.stop()
224222

225223
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+
)
227228
st.stop()
228229

229230
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:
465466

466467
display_table = anomaly_table.copy()
467468
display_table["week"] = display_table["week"].dt.strftime("%Y-%m-%d")
468-
469469
st.dataframe(display_table, width="stretch")
470470

471471
with st.expander("Show merged weekly data"):

0 commit comments

Comments
 (0)