Skip to content

Commit f019a5c

Browse files
committed
 updated exclude_dates to be [Timestamp] in constructor
1 parent aa08735 commit f019a5c

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

pandas/tseries/holiday.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
)
77
from typing import (
88
TYPE_CHECKING,
9-
Any,
109
)
1110
import warnings
1211

@@ -172,7 +171,7 @@ def __init__(
172171
start_date=None,
173172
end_date=None,
174173
days_of_week: tuple | None = None,
175-
exclude_dates: list[Any] | None = None,
174+
exclude_dates: list[Timestamp] | None = None,
176175
) -> None:
177176
"""
178177
Parameters
@@ -264,11 +263,10 @@ class from pandas.tseries.offsets, default None
264263
self.observance = observance
265264
assert days_of_week is None or type(days_of_week) == tuple
266265
self.days_of_week = days_of_week
267-
self.exclude_dates = (
268-
[Timestamp(ex) for ex in exclude_dates]
269-
if exclude_dates is not None
270-
else exclude_dates
266+
assert exclude_dates is None or all(
267+
type(ex) == Timestamp for ex in exclude_dates
271268
)
269+
self.exclude_dates = exclude_dates
272270

273271
def __repr__(self) -> str:
274272
info = ""

0 commit comments

Comments
 (0)