Skip to content

Commit 98c1fe0

Browse files
committed
warn when CustomBusiness day is passed a non-null calendar param value that is not an np.busdaycalendar
1 parent 315b549 commit 98c1fe0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pandas/_libs/tslibs/offsets.pyx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4423,6 +4423,8 @@ cdef class CustomBusinessDay(BusinessDay):
44234423
offset=timedelta(0),
44244424
):
44254425
BusinessDay.__init__(self, n, normalize, offset)
4426+
if (calendar is not None) and not isinstance(calendar, np.busdaycalendar):
4427+
warnings.warn("Warning: `calendar` is expected to be either an instance of `np.busdaycalendar` or `None`.")
44264428
self._init_custom(weekmask, holidays, calendar)
44274429

44284430
cpdef __setstate__(self, state):

0 commit comments

Comments
 (0)