From 9cbff59150dcbef2e620873551c169eaf4a1740b Mon Sep 17 00:00:00 2001 From: kangqiwang Date: Wed, 26 Mar 2025 11:46:46 +0000 Subject: [PATCH] update offsets.pyx to fix #60647 --- pandas/_libs/tslibs/offsets.pyx | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/pandas/_libs/tslibs/offsets.pyx b/pandas/_libs/tslibs/offsets.pyx index a16964435ef50..dedbd6c5faf97 100644 --- a/pandas/_libs/tslibs/offsets.pyx +++ b/pandas/_libs/tslibs/offsets.pyx @@ -216,20 +216,7 @@ cdef _get_calendar(weekmask, holidays, calendar): pass return calendar, holidays - if holidays is None: - holidays = [] - try: - holidays = holidays + calendar.holidays().tolist() - except AttributeError: - pass - holidays = tuple(sorted(_to_dt64D(dt) for dt in holidays)) - - kwargs = {"weekmask": weekmask} - if holidays: - kwargs["holidays"] = holidays - - busdaycalendar = np.busdaycalendar(**kwargs) - return busdaycalendar, holidays + raise ApplyTypeError(f"Unhandled type: {type(calendar).__name__}") cdef _to_dt64D(dt):