Start fixing forecast service 17
This commit is contained in:
@@ -390,7 +390,15 @@ class BakeryDataProcessor:
|
||||
if 'date' not in traffic_clean.columns and 'ds' in traffic_clean.columns:
|
||||
traffic_clean = traffic_clean.rename(columns={'ds': 'date'})
|
||||
|
||||
# 🔧 FIX: Ensure timezone awareness before merge
|
||||
traffic_clean['date'] = pd.to_datetime(traffic_clean['date'])
|
||||
|
||||
# If timezone-naive, localize to UTC
|
||||
if traffic_clean['date'].dt.tz is None:
|
||||
traffic_clean['date'] = traffic_clean['date'].dt.tz_localize('UTC')
|
||||
# If already timezone-aware but not UTC, convert to UTC
|
||||
elif str(traffic_clean['date'].dt.tz) != 'UTC':
|
||||
traffic_clean['date'] = traffic_clean['date'].dt.tz_convert('UTC')
|
||||
|
||||
# Map traffic columns to standard names
|
||||
traffic_mapping = {
|
||||
|
||||
Reference in New Issue
Block a user