diff --git a/doc/source/whatsnew/v1.0.0.rst b/doc/source/whatsnew/v1.0.0.rst index 852694a51e79d..ff1fcb0b9a308 100644 --- a/doc/source/whatsnew/v1.0.0.rst +++ b/doc/source/whatsnew/v1.0.0.rst @@ -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: diff --git a/pandas/core/indexes/range.py b/pandas/core/indexes/range.py index 6ad70841a48b0..bb6e82c747cfc 100644 --- a/pandas/core/indexes/range.py +++ b/pandas/core/indexes/range.py @@ -225,7 +225,7 @@ def _start(self): """ warnings.warn( self._deprecation_message.format("_start", "start"), - DeprecationWarning, + FutureWarning, stacklevel=2, ) return self.start @@ -248,7 +248,7 @@ def _stop(self): # GH 25710 warnings.warn( self._deprecation_message.format("_stop", "stop"), - DeprecationWarning, + FutureWarning, stacklevel=2, ) return self.stop @@ -272,7 +272,7 @@ def _step(self): # GH 25710 warnings.warn( self._deprecation_message.format("_step", "step"), - DeprecationWarning, + FutureWarning, stacklevel=2, ) return self.step diff --git a/pandas/tests/indexes/ranges/test_range.py b/pandas/tests/indexes/ranges/test_range.py index c9ef6677cc7d6..db0cc9828e9e9 100644 --- a/pandas/tests/indexes/ranges/test_range.py +++ b/pandas/tests/indexes/ranges/test_range.py @@ -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):