From 335aff221de75eb63815be8cdf9bed2436402fe1 Mon Sep 17 00:00:00 2001 From: Sam Ehrenstein Date: Mon, 6 Jan 2025 21:58:33 -0500 Subject: [PATCH] switch to error instead of warning --- pandas/_libs/tslibs/offsets.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/_libs/tslibs/offsets.pyx b/pandas/_libs/tslibs/offsets.pyx index 6f1b4983f97c0..132272b534e07 100644 --- a/pandas/_libs/tslibs/offsets.pyx +++ b/pandas/_libs/tslibs/offsets.pyx @@ -4424,7 +4424,7 @@ cdef class CustomBusinessDay(BusinessDay): ): BusinessDay.__init__(self, n, normalize, offset) if (calendar is not None) and not isinstance(calendar, np.busdaycalendar): - warnings.warn("Warning: `calendar` is expected to be either an instance of `np.busdaycalendar` or `None`.") + raise TypeError("`calendar` is expected to be either an instance of `np.busdaycalendar` or `None`.") self._init_custom(weekmask, holidays, calendar) cpdef __setstate__(self, state):