Edwin Salguero commited on
Commit
22dd4c3
·
1 Parent(s): 6b72109

Fix s3_client initialization in main() function - move AWS client initialization outside conditional block

Browse files
Files changed (1) hide show
  1. frontend/app.py +10 -10
frontend/app.py CHANGED
@@ -436,16 +436,16 @@ def main():
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:
442
- print("DEBUG: Analytics loaded successfully in main function")
443
- else:
444
- print("DEBUG: Analytics failed to load in main function")
445
-
446
- # Initialize AWS clients
447
- s3_client, lambda_client = init_aws_clients()
448
- config = load_app_config()
449
 
450
  # Show data mode info
451
  print(f"DEBUG: REAL_DATA_MODE = {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
+ # Initialize AWS clients and config for real data mode
441
+ s3_client, lambda_client = init_aws_clients()
442
+ config = load_app_config()
443
+
444
+ # Force analytics to be available if loading succeeded
445
+ if ANALYTICS_AVAILABLE:
446
+ print("DEBUG: Analytics loaded successfully in main function")
447
+ else:
448
+ print("DEBUG: Analytics failed to load in main function")
449
 
450
  # Show data mode info
451
  print(f"DEBUG: REAL_DATA_MODE = {REAL_DATA_MODE}")