Skip to content

Commit

Permalink
fix: Disabling timezone of dataframe before passing Prophet
Browse files Browse the repository at this point in the history
While running forecasting with Druid. Prophet throws the following exception. This PR removes the timezone info. 
ValueError: Column ds has timezone specified, which is not supported. Remove timezone
apache#11106

@villebro
  • Loading branch information
kkalyan committed Sep 29, 2020
1 parent 89bf765 commit f768977
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions superset/utils/pandas_postprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,7 @@ def _prophet_fit_and_predict( # pylint: disable=too-many-arguments
weekly_seasonality=weekly_seasonality,
daily_seasonality=daily_seasonality,
)
df['ds'] = df['ds'].dt.tz_convert(None)
model.fit(df)
future = model.make_future_dataframe(periods=periods, freq=freq)
forecast = model.predict(future)[["ds", "yhat", "yhat_lower", "yhat_upper"]]
Expand Down

0 comments on commit f768977

Please sign in to comment.