From 72851b36cc06e29a43495d391bfbccc06e017074 Mon Sep 17 00:00:00 2001 From: Jens Keiner Date: Thu, 20 Jun 2024 17:56:49 +0200 Subject: [PATCH] Ensure ad-hoc holidays are proper Pandas timestamps. --- exchange_calendars/exchange_calendar_xbue.py | 7 ++++--- exchange_calendars/exchange_calendar_xphs.py | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/exchange_calendars/exchange_calendar_xbue.py b/exchange_calendars/exchange_calendar_xbue.py index 072af9e1..650c37e1 100644 --- a/exchange_calendars/exchange_calendar_xbue.py +++ b/exchange_calendars/exchange_calendar_xbue.py @@ -344,15 +344,16 @@ def adhoc_holidays(self): "2016-11-28", # Day of National Sovereignty ] - return list( - chain( + return [ + pd.Timestamp(d) + for d in chain( misc_adhocs, market_closures_2002_jan, market_closures_2002_apr, bridge_days, irregular_observances, ) - ) + ] @property def special_closes(self): diff --git a/exchange_calendars/exchange_calendar_xphs.py b/exchange_calendars/exchange_calendar_xphs.py index 7c4c9a34..dba98d67 100644 --- a/exchange_calendars/exchange_calendar_xphs.py +++ b/exchange_calendars/exchange_calendar_xphs.py @@ -410,12 +410,13 @@ def adhoc_holidays(self): "2010-12-31", ] - return list( - chain( + return [ + pd.Timestamp(d) + for d in chain( misc_adhoc, pre_2011_holidays, ChineseNewYearAfter2011, philippines_eid_al_adha, philippines_eid_al_fitr, ) - ) + ]