Skip to content

Commit d050791

Browse files
authored
DEPR: Change current DeprecationWarnings to FutureWarnings (#27113)
* Change current DeprecationWarnings to FutureWarnings in prep for removal in 0.25.0 * Change RangeIndex.start/stop/step back to DeprecationWarning * Change one test warning
1 parent f331c56 commit d050791

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

pandas/core/internals/blocks.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def make_block_same_class(self, values, placement=None, ndim=None,
220220
if dtype is not None:
221221
# issue 19431 fastparquet is passing this
222222
warnings.warn("dtype argument is deprecated, will be removed "
223-
"in a future release.", DeprecationWarning)
223+
"in a future release.", FutureWarning)
224224
if placement is None:
225225
placement = self.mgr_locs
226226
return make_block(values, placement=placement, ndim=ndim,
@@ -1794,7 +1794,7 @@ def formatting_values(self):
17941794
"'ExtensionArray._formatting_values' is deprecated. "
17951795
"Specify 'ExtensionArray._formatter' instead."
17961796
)
1797-
warnings.warn(msg, DeprecationWarning, stacklevel=10)
1797+
warnings.warn(msg, FutureWarning, stacklevel=10)
17981798
return self.values._formatting_values()
17991799

18001800
return self.values
@@ -3056,7 +3056,7 @@ def make_block(values, placement, klass=None, ndim=None, dtype=None,
30563056
if fastpath is not None:
30573057
# GH#19265 pyarrow is passing this
30583058
warnings.warn("fastpath argument is deprecated, will be removed "
3059-
"in a future release.", DeprecationWarning)
3059+
"in a future release.", FutureWarning)
30603060
if klass is None:
30613061
dtype = dtype or values.dtype
30623062
klass = get_block_type(values, dtype)

pandas/tests/extension/decimal/test_decimal.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,6 @@ def _formatting_values(self):
397397

398398
ser = pd.Series(DecimalArray2([decimal.Decimal('1.0')]))
399399

400-
with tm.assert_produces_warning(DeprecationWarning,
400+
with tm.assert_produces_warning(FutureWarning,
401401
check_stacklevel=False):
402402
repr(ser)

pandas/tests/indexes/test_range.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,12 @@ def test_start_stop_step_attrs(self, index, start, stop, step):
171171
assert index.stop == stop
172172
assert index.step == step
173173

174-
def test_deprecated_start_stop_step_attrs(self):
174+
@pytest.mark.parametrize('attr_name', ['_start', '_stop', '_step'])
175+
def test_deprecated_start_stop_step_attrs(self, attr_name):
175176
# GH 26581
176177
idx = self.create_index()
177-
for attr_name in ['_start', '_stop', '_step']:
178-
with tm.assert_produces_warning(DeprecationWarning):
179-
getattr(idx, attr_name)
178+
with tm.assert_produces_warning(DeprecationWarning):
179+
getattr(idx, attr_name)
180180

181181
def test_copy(self):
182182
i = RangeIndex(5, name='Foo')

pandas/tests/internals/test_internals.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ def test_delete(self):
287287
def test_make_block_same_class(self):
288288
# issue 19431
289289
block = create_block('M8[ns, US/Eastern]', [3])
290-
with tm.assert_produces_warning(DeprecationWarning,
290+
with tm.assert_produces_warning(FutureWarning,
291291
check_stacklevel=False):
292292
block.make_block_same_class(block.values,
293293
dtype=block.values.dtype)
@@ -1254,7 +1254,7 @@ def test_holder(typestr, holder):
12541254
def test_deprecated_fastpath():
12551255
# GH#19265
12561256
values = np.random.rand(3, 3)
1257-
with tm.assert_produces_warning(DeprecationWarning,
1257+
with tm.assert_produces_warning(FutureWarning,
12581258
check_stacklevel=False):
12591259
make_block(values, placement=np.arange(3), fastpath=True)
12601260

0 commit comments

Comments
 (0)