Skip to content

CLN: ._data, PeriodIndex arguments #57385

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 4 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Remove ._data
  • Loading branch information
mroeschke committed Feb 12, 2024
commit c95246dcb48bcf8136e3a8ca732b25b1feb6a9b7
17 changes: 0 additions & 17 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,23 +486,6 @@ def _constructor(self) -> Callable[..., Self]:
"""
raise AbstractMethodError(self)

# ----------------------------------------------------------------------
# Internals

@final
@property
def _data(self):
# GH#33054 retained because some downstream packages uses this,
# e.g. fastparquet
# GH#33333
warnings.warn(
f"{type(self).__name__}._data is deprecated and will be removed in "
"a future version. Use public APIs instead.",
DeprecationWarning,
stacklevel=find_stack_level(),
)
return self._mgr

# ----------------------------------------------------------------------
# Axis
_AXIS_ORDERS: list[Literal["index", "columns"]]
Expand Down
6 changes: 1 addition & 5 deletions pandas/tests/frame/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,4 @@ def test_inspect_getmembers(self):
# GH38740
pytest.importorskip("jinja2")
df = DataFrame()
msg = "DataFrame._data is deprecated"
with tm.assert_produces_warning(
DeprecationWarning, match=msg, check_stacklevel=False
):
inspect.getmembers(df)
inspect.getmembers(df)
7 changes: 0 additions & 7 deletions pandas/tests/generic/test_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,13 +303,6 @@ def test_copy_and_deepcopy(self, frame_or_series, shape, func):
assert obj_copy is not obj
tm.assert_equal(obj_copy, obj)

def test_data_deprecated(self, frame_or_series):
obj = frame_or_series()
msg = "(Series|DataFrame)._data is deprecated"
with tm.assert_produces_warning(DeprecationWarning, match=msg):
mgr = obj._data
assert mgr is obj._mgr


class TestNDFrame:
# tests that don't fit elsewhere
Expand Down
6 changes: 1 addition & 5 deletions pandas/tests/series/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,7 @@ def test_inspect_getmembers(self):
# GH38782
pytest.importorskip("jinja2")
ser = Series(dtype=object)
msg = "Series._data is deprecated"
with tm.assert_produces_warning(
DeprecationWarning, match=msg, check_stacklevel=False
):
inspect.getmembers(ser)
inspect.getmembers(ser)

def test_unknown_attribute(self):
# GH#9680
Expand Down