Edwin Salguero
commited on
Commit
ยท
6b72109
1
Parent(s):
ec06fe8
Remove pre-flight FRED API key check - rely on REAL_DATA_MODE after load_config()
Browse files- frontend/app.py +9 -11
frontend/app.py
CHANGED
|
@@ -425,19 +425,17 @@ def create_forecast_plot(historical_data, forecast_data, title="Forecast"):
|
|
| 425 |
def main():
|
| 426 |
"""Main Streamlit application"""
|
| 427 |
|
| 428 |
-
#
|
| 429 |
-
|
| 430 |
-
|
| 431 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 432 |
st.info("Get a free FRED API key at: https://fred.stlouisfed.org/docs/api/api_key.html")
|
| 433 |
st.stop()
|
| 434 |
-
|
| 435 |
-
# Show loading indicator
|
| 436 |
-
with st.spinner("๐ Initializing FRED ML Platform..."):
|
| 437 |
-
# Load configuration
|
| 438 |
-
load_config()
|
| 439 |
-
load_fred_client()
|
| 440 |
-
load_analytics()
|
| 441 |
|
| 442 |
# Force analytics to be available if loading succeeded
|
| 443 |
if ANALYTICS_AVAILABLE:
|
|
|
|
| 425 |
def main():
|
| 426 |
"""Main Streamlit application"""
|
| 427 |
|
| 428 |
+
# Show loading indicator and load everything
|
| 429 |
+
with st.spinner("๐ Initializing FRED ML Platform..."):
|
| 430 |
+
load_config() # pulls from os.environ or st.secrets
|
| 431 |
+
load_fred_client() # sets FRED_API_AVAILABLE
|
| 432 |
+
load_analytics() # sets ANALYTICS_AVAILABLE
|
| 433 |
+
|
| 434 |
+
# Now check whether we're actually in "real data" mode
|
| 435 |
+
if not REAL_DATA_MODE:
|
| 436 |
+
st.error("โ FRED API key not configured. Please set FRED_API_KEY environment variable.")
|
| 437 |
st.info("Get a free FRED API key at: https://fred.stlouisfed.org/docs/api/api_key.html")
|
| 438 |
st.stop()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 439 |
|
| 440 |
# Force analytics to be available if loading succeeded
|
| 441 |
if ANALYTICS_AVAILABLE:
|