diff --git a/R/R/prophet.R b/R/R/prophet.R index 6318d04..05d531f 100644 --- a/R/R/prophet.R +++ b/R/R/prophet.R @@ -169,7 +169,7 @@ validate_inputs <- function(m) { stop('Holidays dataframe must have ds field.') } m$holidays$ds <- as.Date(m$holidays$ds) - if (any(is.na(m$holidays))) { + if (any(is.na(m$holidays$ds)) | any(is.na(m$holidays$holiday))) { stop('Found NA in the holidays dataframe.') } has.lower <- exists('lower_window', where = m$holidays) diff --git a/python/fbprophet/forecaster.py b/python/fbprophet/forecaster.py index 038ff8c..18aec08 100644 --- a/python/fbprophet/forecaster.py +++ b/python/fbprophet/forecaster.py @@ -169,8 +169,11 @@ class Prophet(object): raise ValueError('holidays must be a DataFrame with "ds" and ' '"holiday" columns.') self.holidays['ds'] = pd.to_datetime(self.holidays['ds']) - if self.holidays.isnull().any().any(): - raise ValueError('Found a NaN in holidays dataframe') + if ( + self.holidays['ds'].isnull().any() + or self.holidays['holiday'].isnull().any() + ): + raise ValueError('Found a NaN in holidays dataframe.') has_lower = 'lower_window' in self.holidays has_upper = 'upper_window' in self.holidays if has_lower + has_upper == 1: