Skip to content
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

DEPR: start with Deprecation instead of FutureWarning for NDFrame._data #53994

Merged
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/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ def _data(self):
warnings.warn(
f"{type(self).__name__}._data is deprecated and will be removed in "
"a future version. Use public APIs instead.",
FutureWarning,
DeprecationWarning,
stacklevel=find_stack_level(),
)
return self._mgr
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/frame/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,6 @@ def test_inspect_getmembers(self):
df = DataFrame()
msg = "DataFrame._data is deprecated"
with tm.assert_produces_warning(
FutureWarning, match=msg, check_stacklevel=False
DeprecationWarning, match=msg, check_stacklevel=False
):
inspect.getmembers(df)
2 changes: 1 addition & 1 deletion pandas/tests/generic/test_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ def test_copy_and_deepcopy(self, frame_or_series, shape, func):
def test_data_deprecated(self, frame_or_series):
obj = frame_or_series()
msg = "(Series|DataFrame)._data is deprecated"
with tm.assert_produces_warning(FutureWarning, match=msg):
with tm.assert_produces_warning(DeprecationWarning, match=msg):
mgr = obj._data
assert mgr is obj._mgr

Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/series/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def test_inspect_getmembers(self):
ser = Series(dtype=object)
msg = "Series._data is deprecated"
with tm.assert_produces_warning(
FutureWarning, match=msg, check_stacklevel=False
DeprecationWarning, match=msg, check_stacklevel=False
):
inspect.getmembers(ser)

Expand Down