-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TYP: PandasObject._cache #32775
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
TYP: PandasObject._cache #32775
Conversation
@@ -63,7 +65,7 @@ def __repr__(self) -> str: | |||
# Should be overwritten by base classes | |||
return object.__repr__(self) | |||
|
|||
def _reset_cache(self, key=None): | |||
def _reset_cache(self, key: Optional[str] = None) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we ever actually pass a key?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Twice, both times in groupby/groupby.py.
Just out of curiosity why do you think this is better placed in PandasObject? |
My motivation is to have it set on the same class as _reset_cache is set on, because those two belong logically together. This would also prevent that _cache attribute is set on a child class that is incompatible with _reset_cache. |
thanks @topper-123 |
Move
_cache: Dict[str, Any]
fragment to PandasObject, where it belongs + related changes.