From 7626217b7de6ca4b0c82f41912309c6a239a6013 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 5 Nov 2025 14:00:10 +0000 Subject: [PATCH] Fix orchestration saga failure due to missing pandas dependency Root cause analysis: - The orchestration saga was failing at the 'fetch_shared_data_snapshot' step - Lines 350-356 had a logic error: tried to import pandas in exception handler after pandas import already failed - This caused an uncaught exception that propagated up and failed the entire saga The fix: - Replaced pandas DataFrame placeholder with a simple dict for traffic_predictions - Since traffic predictions are marked as "not yet implemented", pandas is not needed yet - This eliminates the pandas dependency from the orchestrator service - When traffic predictions are implemented in Phase 5, the dict can be converted to DataFrame Impact: - Orchestration saga will no longer fail due to missing pandas - AI enhancement warning will still appear (requires separate fix to add pandas to requirements if needed) - Traffic predictions placeholder now uses empty dict instead of empty DataFrame --- .../app/services/orchestration_saga.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/services/orchestrator/app/services/orchestration_saga.py b/services/orchestrator/app/services/orchestration_saga.py index d21fccd3..20d1cddf 100644 --- a/services/orchestrator/app/services/orchestration_saga.py +++ b/services/orchestrator/app/services/orchestration_saga.py @@ -344,16 +344,10 @@ class OrchestrationSaga: context['event_calendar'] = [] # NEW: Placeholder for traffic predictions (Phase 5) - try: - # Note: Implement traffic forecasting in Phase 5 - # For now, initialize as empty DataFrame - import pandas as pd - context['traffic_predictions'] = pd.DataFrame() - logger.info("Traffic predictions: not yet implemented, using empty DataFrame") - except Exception as e: - logger.warning(f"Could not fetch traffic predictions: {e}") - import pandas as pd - context['traffic_predictions'] = pd.DataFrame() + # Note: Implement traffic forecasting in Phase 5 + # For now, initialize as empty dict (will be converted to DataFrame when implemented) + context['traffic_predictions'] = {} + logger.info("Traffic predictions: not yet implemented, using empty dict") logger.info( f"Shared data snapshot fetched successfully: "