gerrymanoim / exchange_calendars

Calendars for various securities exchanges.
Apache License 2.0
425 stars 135 forks source link

BUG: Fix end-date-only TZ logic in holiday.py #370

Closed herebebeasties closed 7 months ago

herebebeasties commented 7 months ago

I don't think anything is actually using this, so hasn't tripped over it yet, but there is what looks like a "copy/pasta" bug in holidays.py that this fixes around handling of the range when the TZ is only specified on the end date. There is a missing assertion for matching start and end date timezones, too (there is currently what ruff calls a "pointless equality check" whose result is not checked).

maread99 commented 7 months ago

Thanks again @herebebeasties.

I believe the only calendar that uses this module is XKRX. There's been talk for a while (#128) of moving the calendar to hard-coded holidays and a standard implementation. I suspect that would allow the removal of the pandas_extensions directory and everything under it together with (possibly) the korean_lunar_calendar dependency.