Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ app = marimo.App()
|
|
11 |
@app.cell
|
12 |
def _(mo):
|
13 |
csv_upload = mo.ui.file(label="Upload Keyword CSV (1 column)")
|
14 |
-
# pull secrets from env
|
15 |
api_key = os.environ.get("GOOGLE_API_KEY", "")
|
16 |
cse_id = os.environ.get("GOOGLE_CSE_ID", "")
|
17 |
country = mo.ui.text(label="Country Code (e.g. UK)", value="UK")
|
@@ -62,8 +62,6 @@ def _(keywords, api_key, cse_id, country, language, database, serp_table, timest
|
|
62 |
|
63 |
movement = compare_clusters(clusters1, clusters2)
|
64 |
return fig1, fig2, movement
|
65 |
-
|
66 |
-
# Explicit fallback
|
67 |
return None, None, None
|
68 |
|
69 |
# 5) Display the two network graphs
|
@@ -72,7 +70,7 @@ def _(fig1, fig2):
|
|
72 |
if fig1 and fig2:
|
73 |
display(fig1)
|
74 |
display(fig2)
|
75 |
-
|
76 |
|
77 |
# 6) Show the movement table
|
78 |
@app.cell
|
|
|
11 |
@app.cell
|
12 |
def _(mo):
|
13 |
csv_upload = mo.ui.file(label="Upload Keyword CSV (1 column)")
|
14 |
+
# pull secrets from env (set in HF Space Secrets)
|
15 |
api_key = os.environ.get("GOOGLE_API_KEY", "")
|
16 |
cse_id = os.environ.get("GOOGLE_CSE_ID", "")
|
17 |
country = mo.ui.text(label="Country Code (e.g. UK)", value="UK")
|
|
|
62 |
|
63 |
movement = compare_clusters(clusters1, clusters2)
|
64 |
return fig1, fig2, movement
|
|
|
|
|
65 |
return None, None, None
|
66 |
|
67 |
# 5) Display the two network graphs
|
|
|
70 |
if fig1 and fig2:
|
71 |
display(fig1)
|
72 |
display(fig2)
|
73 |
+
return None
|
74 |
|
75 |
# 6) Show the movement table
|
76 |
@app.cell
|