Skip to content

Commit fb5661f

Browse files
committed
Fix PandasObject cache attribute name
1 parent c4b997e commit fb5661f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

pandas/core/base.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,9 @@ class PandasObject(DirNamesMixin):
8080
Baseclass for various pandas objects.
8181
"""
8282

83-
# results from calls to methods decorated with cache_readonly get added to _cache
84-
_cache: Dict[str, Any]
83+
# results from calls to methods decorated with
84+
# cache_readonly get added to _cache_property
85+
_cache_property: Dict[str, Any]
8586

8687
@property
8788
def _constructor(self):
@@ -101,12 +102,12 @@ def _reset_cache(self, key: Optional[str] = None) -> None:
101102
"""
102103
Reset cached properties. If ``key`` is passed, only clears that key.
103104
"""
104-
if not hasattr(self, "_cache"):
105+
if not hasattr(self, "_cache_property"):
105106
return
106107
if key is None:
107-
self._cache.clear()
108+
self._cache_property.clear()
108109
else:
109-
self._cache.pop(key, None)
110+
self._cache_property.pop(key, None)
110111

111112
def __sizeof__(self) -> int:
112113
"""

0 commit comments

Comments
 (0)