Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
isinstance to check exclude_data
  • Loading branch information
sharkipelago committed Jun 10, 2025
commit 27cca3d2056ea8a027cc4e8f14131c3652f73f62
2 changes: 1 addition & 1 deletion pandas/tseries/holiday.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ class from pandas.tseries.offsets, default None
self.observance = observance
assert days_of_week is None or type(days_of_week) == tuple
Copy link
Contributor Author

@sharkipelago sharkipelago Jun 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I also switch this to throw a ValueError on failing? Or would that be a separate PR?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A separate PR would be better, thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this, should I open a new issue? Or just make another PR?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just another PR is fine

self.days_of_week = days_of_week
if exclude_dates is not None and type(exclude_dates) != DatetimeIndex:
if not (exclude_dates is None or isinstance(exclude_dates, DatetimeIndex)):
raise ValueError("exclude_dates must be None or of type DatetimeIndex.")
self.exclude_dates = exclude_dates

Expand Down