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. Change RangeIndex._start/_stop/_step to FutureWarning #30482

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 doc/source/whatsnew/v1.0.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ Deprecations
Usage of ``json_normalize`` as ``pandas.io.json.json_normalize`` is now deprecated and
it is recommended to use ``json_normalize`` as :func:`pandas.json_normalize` instead (:issue:`27586`).
- :meth:`DataFrame.to_stata`, :meth:`DataFrame.to_feather`, and :meth:`DataFrame.to_parquet` argument "fname" is deprecated, use "path" instead (:issue:`23574`)

- The deprecated internal attributes ``_start``, ``_stop`` and ``_step`` of :class:`RangeIndex` now raise a ``FutureWarning`` instead of a ``DeprecationWarning`` (:issue:`26581`)

.. _whatsnew_1000.prior_deprecations:

Expand Down
6 changes: 3 additions & 3 deletions pandas/core/indexes/range.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def _start(self):
"""
warnings.warn(
self._deprecation_message.format("_start", "start"),
DeprecationWarning,
FutureWarning,
stacklevel=2,
)
return self.start
Expand All @@ -248,7 +248,7 @@ def _stop(self):
# GH 25710
warnings.warn(
self._deprecation_message.format("_stop", "stop"),
DeprecationWarning,
FutureWarning,
stacklevel=2,
)
return self.stop
Expand All @@ -272,7 +272,7 @@ def _step(self):
# GH 25710
warnings.warn(
self._deprecation_message.format("_step", "step"),
DeprecationWarning,
FutureWarning,
stacklevel=2,
)
return self.step
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/indexes/ranges/test_range.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def test_start_stop_step_attrs(self, index, start, stop, step):
def test_deprecated_start_stop_step_attrs(self, attr_name):
# GH 26581
idx = self.create_index()
with tm.assert_produces_warning(DeprecationWarning):
with tm.assert_produces_warning(FutureWarning):
getattr(idx, attr_name)

def test_copy(self):
Expand Down