Skip to content

Bug in AbstractHolidayCalendar.holidays #31415

Closed
@dhirschfeld

Description

@dhirschfeld

...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 "<ipython-input-58-022244d4e794>", line 1, in <module>
    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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions