Bug in AbstractHolidayCalendar.holidays (original) (raw)

...when there are no rules.

from pandas.tseries.holiday import AbstractHolidayCalendar

class ExampleCalendar(AbstractHolidayCalendar): pass

cal = ExampleCalendar()

In [58]: cal.holidays(pd.Timestamp('01-Jan-2020'), pd.Timestamp('01-Jan-2021')) Traceback (most recent call last):

File "", line 1, in cal.holidays(pd.Timestamp('01-Jan-2020'), pd.Timestamp('01-Jan-2021'))

File "C:\Users\dhirschf\envs\dev\lib\site-packages\pandas\tseries\holiday.py", line 422, in holidays self._cache = (start, end, holidays.sort_index())

AttributeError: 'NoneType' object has no attribute 'sort_index'

In [59]: pd.version Out[59]: '0.25.3'