Skip to content

Commit

Permalink
DEPR. Change RangeIndex._start/_stop/_step to FutureWarning (#30482)
Browse files Browse the repository at this point in the history
* DEPR. Change RangeIndex.start/stop/step to FutureWarning

* Add whatsnew

* Modify wording in whatsnew
  • Loading branch information
mroeschke authored and jbrockmendel committed Dec 26, 2019
1 parent 7b2eb54 commit a060674
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
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

0 comments on commit a060674

Please sign in to comment.