Closed jgiacobbi closed 1 year ago
Have there been any updates with this issue?
I've also experienced a change in behaviour with the CFE calendar after upgrading to pandas 2.0.2.
Reproducible example:
Before upgrading:
pandas==1.3.5
pandas-market-calendars==4.1.4
>>> import pandas_market_calendars as mcal
>>> cfe = mcal.get_calendar('CFE')
>>> cfe.valid_days(dt.date(2023, 2, 17), dt.date(2023, 2, 22))
DatetimeIndex(['2023-02-17 00:00:00+00:00', '2023-02-21 00:00:00+00:00',
'2023-02-22 00:00:00+00:00'],
dtype='datetime64[ns, UTC]', freq='C')
After upgrading:
pandas==2.0.2
pandas-market-calendars==4.1.4
>>> import pandas_market_calendars as mcal
>>> cfe = mcal.get_calendar('CFE')
>>> cfe.valid_days(dt.date(2023, 2, 17), dt.date(2023, 2, 22))
DatetimeIndex(['2023-02-17 00:00:00+00:00', '2023-02-20 00:00:00+00:00',
'2023-02-21 00:00:00+00:00', '2023-02-22 00:00:00+00:00'],
dtype='datetime64[ns, UTC]', freq='C')
The latter case seems to be ignoring the 20 February 2023 market holiday
I believe this is related to #265 as the behavior of the Holiday() function in pandas seems to have an undocumented change in v2.0.0 where the function that is passed in to the observance parameter prior to 2.0.0 would be a function that was passed a single datetime, now post 2.0.0 it appears the function will be passes a list of datetimes. Because the change is not documented, this requires analysis to reverse out the change.
Fixed in PR #279
1:
1a (output):
2:
3: After upgrading to pandas 2.0.0, the CBOE Index Options calendar fails to recognize CBOE's listed holidays (https://www.cboe.com/about/hours). The above output shows what is happening: holidays with open and close times. The expected output is empty dataframes for each holiday.
After downgrading to pandas 1.5.3 all holiday schedules return empty dataframes as expected.