Skip to content

Commit 32cbbc2

Browse files
committed
Added test and whatsnew
1 parent a61c147 commit 32cbbc2

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

doc/source/whatsnew/v3.0.0.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,7 @@ Other Removals
476476
- Disallow indexing an :class:`Index` with a boolean indexer of length zero, it now raises ``ValueError`` (:issue:`55820`)
477477
- Disallow non-standard (``np.ndarray``, :class:`Index`, :class:`ExtensionArray`, or :class:`Series`) to :func:`isin`, :func:`unique`, :func:`factorize` (:issue:`52986`)
478478
- Disallow passing a pandas type to :meth:`Index.view` (:issue:`55709`)
479+
- Disallow passing objects other than ``np.busdaycalendar`` to ``calendar`` parameter in :class:`CustomBusinessDay` (:issue:`60647`)
479480
- Disallow units other than "s", "ms", "us", "ns" for datetime64 and timedelta64 dtypes in :func:`array` (:issue:`53817`)
480481
- Removed "freq" keyword from :class:`PeriodArray` constructor, use "dtype" instead (:issue:`52462`)
481482
- Removed 'fastpath' keyword in :class:`Categorical` constructor (:issue:`20110`)

pandas/tests/tseries/offsets/test_custom_business_day.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010
import numpy as np
1111
import pytest
1212

13-
from pandas._libs.tslibs.offsets import CDay
13+
from pandas._libs.tslibs.offsets import (
14+
BDay,
15+
CDay,
16+
CustomBusinessDay,
17+
)
1418

1519
from pandas import (
1620
_testing as tm,
@@ -97,3 +101,9 @@ def test_pickle_compat_0_14_1(self, datapath):
97101
cday0_14_1 = read_pickle(pth)
98102
cday = CDay(holidays=hdays)
99103
assert cday == cday0_14_1
104+
105+
def test_type_error_calendar(self):
106+
bd = BDay(1)
107+
msg = "Only np.busdaycalendar is supported for calendar"
108+
with pytest.raises(TypeError, match=msg):
109+
CustomBusinessDay(calendar=bd)

0 commit comments

Comments
 (0)