Skip to content

CLN: clean ._hidden_attrs #51321

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

Merged
merged 2 commits into from
Feb 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pandas/core/arrays/sparse/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ class SparseArray(OpsMixin, PandasObject, ExtensionArray):
"""

_subtyp = "sparse_array" # register ABCSparseArray
_hidden_attrs = PandasObject._hidden_attrs | frozenset(["get_values"])
_hidden_attrs = PandasObject._hidden_attrs | frozenset([])
_sparse_index: SparseIndex
_sparse_values: np.ndarray
_dtype: SparseDtype
Expand Down
4 changes: 1 addition & 3 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,7 @@ class NDFrame(PandasObject, indexing.IndexingMixin):
]
_internal_names_set: set[str] = set(_internal_names)
_accessors: set[str] = set()
_hidden_attrs: frozenset[str] = frozenset(
["_AXIS_NAMES", "_AXIS_NUMBERS", "get_values"]
)
_hidden_attrs: frozenset[str] = frozenset([])
_metadata: list[str] = []
_is_copy: weakref.ReferenceType[NDFrame] | None = None
_mgr: Manager
Expand Down
4 changes: 1 addition & 3 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,7 @@ class Series(base.IndexOpsMixin, NDFrame): # type: ignore[misc]
_internal_names_set = {"index"} | NDFrame._internal_names_set
_accessors = {"dt", "cat", "str", "sparse"}
_hidden_attrs = (
base.IndexOpsMixin._hidden_attrs
| NDFrame._hidden_attrs
| frozenset(["compress", "ptp"])
base.IndexOpsMixin._hidden_attrs | NDFrame._hidden_attrs | frozenset([])
)

# Override cache_readonly bc Series is mutable
Expand Down