Skip to content

Commit 582c6bc

Browse files
committed
Revert "Switch DeprecationWarning to FutureWarning"
1 parent 92eb560 commit 582c6bc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+54
-50
lines changed

pandas/core/frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ def __init__(
717717
f"Passing a {type(data).__name__} to {type(self).__name__} "
718718
"is deprecated and will raise in a future version. "
719719
"Use public APIs instead.",
720-
FutureWarning,
720+
DeprecationWarning,
721721
stacklevel=2,
722722
)
723723

pandas/core/series.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ def __init__(
380380
f"Passing a {type(data).__name__} to {type(self).__name__} "
381381
"is deprecated and will raise in a future version. "
382382
"Use public APIs instead.",
383-
FutureWarning,
383+
DeprecationWarning,
384384
stacklevel=2,
385385
)
386386
data = data.copy(deep=False)
@@ -408,7 +408,7 @@ def __init__(
408408
f"Passing a {type(data).__name__} to {type(self).__name__} "
409409
"is deprecated and will raise in a future version. "
410410
"Use public APIs instead.",
411-
FutureWarning,
411+
DeprecationWarning,
412412
stacklevel=2,
413413
)
414414

@@ -478,7 +478,7 @@ def __init__(
478478
f"Passing a {type(data).__name__} to {type(self).__name__} "
479479
"is deprecated and will raise in a future version. "
480480
"Use public APIs instead.",
481-
FutureWarning,
481+
DeprecationWarning,
482482
stacklevel=2,
483483
)
484484
allow_mgr = True

pandas/tests/arrays/interval/test_interval_pyarrow.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ def test_arrow_array_missing():
8080
assert result.storage.equals(expected)
8181

8282

83-
@pytest.mark.filterwarnings("ignore:Passing a BlockManager to DataFrame:FutureWarning")
83+
@pytest.mark.filterwarnings(
84+
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
85+
)
8486
@pytest.mark.parametrize(
8587
"breaks",
8688
[[0.0, 1.0, 2.0, 3.0], pd.date_range("2017", periods=4, freq="D")],
@@ -114,7 +116,9 @@ def test_arrow_table_roundtrip(breaks):
114116
tm.assert_frame_equal(result, expected[0:0])
115117

116118

117-
@pytest.mark.filterwarnings("ignore:Passing a BlockManager to DataFrame:FutureWarning")
119+
@pytest.mark.filterwarnings(
120+
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
121+
)
118122
@pytest.mark.parametrize(
119123
"breaks",
120124
[[0.0, 1.0, 2.0, 3.0], pd.date_range("2017", periods=4, freq="D")],

pandas/tests/arrays/masked/test_arrow_compat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import pandas._testing as tm
66

77
pytestmark = pytest.mark.filterwarnings(
8-
"ignore:Passing a BlockManager to DataFrame:FutureWarning"
8+
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
99
)
1010

1111
pa = pytest.importorskip("pyarrow")

pandas/tests/arrays/period/test_arrow_compat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
)
1313

1414
pytestmark = pytest.mark.filterwarnings(
15-
"ignore:Passing a BlockManager to DataFrame:FutureWarning"
15+
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
1616
)
1717

1818

pandas/tests/copy_view/test_constructors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def test_series_from_index_different_dtypes():
123123
def test_series_from_block_manager_different_dtype():
124124
ser = Series([1, 2, 3], dtype="int64")
125125
msg = "Passing a SingleBlockManager to Series"
126-
with tm.assert_produces_warning(FutureWarning, match=msg):
126+
with tm.assert_produces_warning(DeprecationWarning, match=msg):
127127
ser2 = Series(ser._mgr, dtype="int32")
128128
assert not np.shares_memory(get_array(ser), get_array(ser2))
129129
assert ser2._mgr._has_no_reference(0)
@@ -137,7 +137,7 @@ def test_dataframe_constructor_mgr_or_df(columns, use_mgr):
137137

138138
if use_mgr:
139139
data = df._mgr
140-
warn = FutureWarning
140+
warn = DeprecationWarning
141141
else:
142142
data = df
143143
warn = None

pandas/tests/frame/test_block_internals.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ def test_setitem_invalidates_datetime_index_freq(self):
4444
def test_cast_internals(self, float_frame):
4545
msg = "Passing a BlockManager to DataFrame"
4646
with tm.assert_produces_warning(
47-
FutureWarning, match=msg, check_stacklevel=False
47+
DeprecationWarning, match=msg, check_stacklevel=False
4848
):
4949
casted = DataFrame(float_frame._mgr, dtype=int)
5050
expected = DataFrame(float_frame._series, dtype=int)
5151
tm.assert_frame_equal(casted, expected)
5252

5353
with tm.assert_produces_warning(
54-
FutureWarning, match=msg, check_stacklevel=False
54+
DeprecationWarning, match=msg, check_stacklevel=False
5555
):
5656
casted = DataFrame(float_frame._mgr, dtype=np.int32)
5757
expected = DataFrame(float_frame._series, dtype=np.int32)

pandas/tests/frame/test_constructors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1729,7 +1729,7 @@ def test_constructor_manager_resize(self, float_frame):
17291729

17301730
msg = "Passing a BlockManager to DataFrame"
17311731
with tm.assert_produces_warning(
1732-
FutureWarning, match=msg, check_stacklevel=False
1732+
DeprecationWarning, match=msg, check_stacklevel=False
17331733
):
17341734
result = DataFrame(float_frame._mgr, index=index, columns=columns)
17351735
tm.assert_index_equal(result.index, Index(index))

pandas/tests/io/json/test_readlines.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from pandas.io.json._json import JsonReader
1616

1717
pytestmark = pytest.mark.filterwarnings(
18-
"ignore:Passing a BlockManager to DataFrame:FutureWarning"
18+
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
1919
)
2020

2121

pandas/tests/io/parser/common/test_chunksize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import pandas._testing as tm
1919

2020
pytestmark = pytest.mark.filterwarnings(
21-
"ignore:Passing a BlockManager to DataFrame:FutureWarning"
21+
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
2222
)
2323

2424

0 commit comments

Comments
 (0)