From f660264e23135b241cdc4b1e50db71224bc146a3 Mon Sep 17 00:00:00 2001 From: Ben Letham Date: Mon, 13 May 2019 15:00:45 -0700 Subject: [PATCH] Don't allow timezones in pandas datetime --- python/fbprophet/forecaster.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python/fbprophet/forecaster.py b/python/fbprophet/forecaster.py index 921dd24..f478b39 100644 --- a/python/fbprophet/forecaster.py +++ b/python/fbprophet/forecaster.py @@ -239,6 +239,11 @@ class Prophet(object): if df['ds'].dtype == np.int64: df['ds'] = df['ds'].astype(str) df['ds'] = pd.to_datetime(df['ds']) + if df['ds'].dt.tz is not None: + raise ValueError( + 'Column ds has timezone specified, which is not supported. ' + 'Remove timezone.' + ) if df['ds'].isnull().any(): raise ValueError('Found NaN in column ds.') for name in self.extra_regressors: