You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by dp...@apache.org on 2020/10/01 12:04:52 UTC
[incubator-superset] branch 0.38 updated: fix: Disabling timezone
of dataframe before passing Prophet (#11107)
This is an automated email from the ASF dual-hosted git repository.
dpgaspar pushed a commit to branch 0.38
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
The following commit(s) were added to refs/heads/0.38 by this push:
new 248e914 fix: Disabling timezone of dataframe before passing Prophet (#11107)
248e914 is described below
commit 248e914199aaa08eef8e1f7c979fb5f32fc2164b
Author: Kalyan <ka...@gmail.com>
AuthorDate: Wed Sep 30 11:38:37 2020 -0700
fix: Disabling timezone of dataframe before passing Prophet (#11107)
* fix: Disabling timezone of dataframe before passing Prophet
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
https://github.com/apache/incubator-superset/issues/11106
@villebro
* Update pandas_postprocessing.py
* Update superset/utils/pandas_postprocessing.py
Co-authored-by: Ville Brofeldt <33...@users.noreply.github.com>
Co-authored-by: Ville Brofeldt <33...@users.noreply.github.com>
---
superset/utils/pandas_postprocessing.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/superset/utils/pandas_postprocessing.py b/superset/utils/pandas_postprocessing.py
index 73336eb..aceb78f 100644
--- a/superset/utils/pandas_postprocessing.py
+++ b/superset/utils/pandas_postprocessing.py
@@ -600,6 +600,8 @@ def _prophet_fit_and_predict( # pylint: disable=too-many-arguments
weekly_seasonality=weekly_seasonality,
daily_seasonality=daily_seasonality,
)
+ if df["ds"].dt.tz:
+ 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"]]