-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Disable class level caching in AbstractHolidayCalendar #9552
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The expected use of this is that there is only one set of rules per holiday class. Namely there is a one-to-one mapping between holiday calendars and rules. Ideally, if you change the rules you would create a new class. However, this isn't exactly obvious from how things work and I don't see the harm in making the cache on the instance rather than the class (see #6719) for some design discussion. |
That seems like a strange design to me - if the rules are a class level attribute then there is no instance level data stored on the class and all the methods could be classmethods and the user would never have to actually instantiate the subclass to use it. It also seems contrary to |
AbstractHolidayCalendar
By caching at the class level it prevents instances from defining different rules - e.g.
https://github.com/pydata/pandas/blob/a72d95163b4d268012709255d7a52bbe5c1a7eb6/pandas/tseries/holiday.py#L351-L357
The text was updated successfully, but these errors were encountered: