Skip to content

Commit

Permalink
Revert "Switch DeprecationWarning to FutureWarning"
Browse files Browse the repository at this point in the history
  • Loading branch information
Aloqeely committed May 22, 2024
1 parent 92eb560 commit 582c6bc
Show file tree
Hide file tree
Showing 44 changed files with 54 additions and 50 deletions.
2 changes: 1 addition & 1 deletion pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ def __init__(
f"Passing a {type(data).__name__} to {type(self).__name__} "
"is deprecated and will raise in a future version. "
"Use public APIs instead.",
FutureWarning,
DeprecationWarning,
stacklevel=2,
)

Expand Down
6 changes: 3 additions & 3 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ def __init__(
f"Passing a {type(data).__name__} to {type(self).__name__} "
"is deprecated and will raise in a future version. "
"Use public APIs instead.",
FutureWarning,
DeprecationWarning,
stacklevel=2,
)
data = data.copy(deep=False)
Expand Down Expand Up @@ -408,7 +408,7 @@ def __init__(
f"Passing a {type(data).__name__} to {type(self).__name__} "
"is deprecated and will raise in a future version. "
"Use public APIs instead.",
FutureWarning,
DeprecationWarning,
stacklevel=2,
)

Expand Down Expand Up @@ -478,7 +478,7 @@ def __init__(
f"Passing a {type(data).__name__} to {type(self).__name__} "
"is deprecated and will raise in a future version. "
"Use public APIs instead.",
FutureWarning,
DeprecationWarning,
stacklevel=2,
)
allow_mgr = True
Expand Down
8 changes: 6 additions & 2 deletions pandas/tests/arrays/interval/test_interval_pyarrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ def test_arrow_array_missing():
assert result.storage.equals(expected)


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


@pytest.mark.filterwarnings("ignore:Passing a BlockManager to DataFrame:FutureWarning")
@pytest.mark.filterwarnings(
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
)
@pytest.mark.parametrize(
"breaks",
[[0.0, 1.0, 2.0, 3.0], pd.date_range("2017", periods=4, freq="D")],
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/arrays/masked/test_arrow_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pandas._testing as tm

pytestmark = pytest.mark.filterwarnings(
"ignore:Passing a BlockManager to DataFrame:FutureWarning"
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
)

pa = pytest.importorskip("pyarrow")
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/arrays/period/test_arrow_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
)

pytestmark = pytest.mark.filterwarnings(
"ignore:Passing a BlockManager to DataFrame:FutureWarning"
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
)


Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/copy_view/test_constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def test_series_from_index_different_dtypes():
def test_series_from_block_manager_different_dtype():
ser = Series([1, 2, 3], dtype="int64")
msg = "Passing a SingleBlockManager to Series"
with tm.assert_produces_warning(FutureWarning, match=msg):
with tm.assert_produces_warning(DeprecationWarning, match=msg):
ser2 = Series(ser._mgr, dtype="int32")
assert not np.shares_memory(get_array(ser), get_array(ser2))
assert ser2._mgr._has_no_reference(0)
Expand All @@ -137,7 +137,7 @@ def test_dataframe_constructor_mgr_or_df(columns, use_mgr):

if use_mgr:
data = df._mgr
warn = FutureWarning
warn = DeprecationWarning
else:
data = df
warn = None
Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/frame/test_block_internals.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ def test_setitem_invalidates_datetime_index_freq(self):
def test_cast_internals(self, float_frame):
msg = "Passing a BlockManager to DataFrame"
with tm.assert_produces_warning(
FutureWarning, match=msg, check_stacklevel=False
DeprecationWarning, match=msg, check_stacklevel=False
):
casted = DataFrame(float_frame._mgr, dtype=int)
expected = DataFrame(float_frame._series, dtype=int)
tm.assert_frame_equal(casted, expected)

with tm.assert_produces_warning(
FutureWarning, match=msg, check_stacklevel=False
DeprecationWarning, match=msg, check_stacklevel=False
):
casted = DataFrame(float_frame._mgr, dtype=np.int32)
expected = DataFrame(float_frame._series, dtype=np.int32)
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/frame/test_constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -1729,7 +1729,7 @@ def test_constructor_manager_resize(self, float_frame):

msg = "Passing a BlockManager to DataFrame"
with tm.assert_produces_warning(
FutureWarning, match=msg, check_stacklevel=False
DeprecationWarning, match=msg, check_stacklevel=False
):
result = DataFrame(float_frame._mgr, index=index, columns=columns)
tm.assert_index_equal(result.index, Index(index))
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/json/test_readlines.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from pandas.io.json._json import JsonReader

pytestmark = pytest.mark.filterwarnings(
"ignore:Passing a BlockManager to DataFrame:FutureWarning"
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
)


Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/parser/common/test_chunksize.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import pandas._testing as tm

pytestmark = pytest.mark.filterwarnings(
"ignore:Passing a BlockManager to DataFrame:FutureWarning"
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
)


Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/parser/common/test_common_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import pandas._testing as tm

pytestmark = pytest.mark.filterwarnings(
"ignore:Passing a BlockManager to DataFrame:FutureWarning"
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
)

xfail_pyarrow = pytest.mark.usefixtures("pyarrow_xfail")
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/parser/common/test_data_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from pandas.io.parsers import TextParser

pytestmark = pytest.mark.filterwarnings(
"ignore:Passing a BlockManager to DataFrame:FutureWarning"
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
)

xfail_pyarrow = pytest.mark.usefixtures("pyarrow_xfail")
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/parser/common/test_decimal.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import pandas._testing as tm

pytestmark = pytest.mark.filterwarnings(
"ignore:Passing a BlockManager to DataFrame:FutureWarning"
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
)


Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/parser/common/test_file_buffer_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import pandas._testing as tm

pytestmark = pytest.mark.filterwarnings(
"ignore:Passing a BlockManager to DataFrame:FutureWarning"
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
)

xfail_pyarrow = pytest.mark.usefixtures("pyarrow_xfail")
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/parser/common/test_float.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import pandas._testing as tm

pytestmark = pytest.mark.filterwarnings(
"ignore:Passing a BlockManager to DataFrame:FutureWarning"
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
)
xfail_pyarrow = pytest.mark.usefixtures("pyarrow_xfail")
skip_pyarrow = pytest.mark.usefixtures("pyarrow_skip")
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/parser/common/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import pandas._testing as tm

pytestmark = pytest.mark.filterwarnings(
"ignore:Passing a BlockManager to DataFrame:FutureWarning"
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
)

xfail_pyarrow = pytest.mark.usefixtures("pyarrow_xfail")
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/parser/common/test_inf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import pandas._testing as tm

pytestmark = pytest.mark.filterwarnings(
"ignore:Passing a BlockManager to DataFrame:FutureWarning"
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
)

xfail_pyarrow = pytest.mark.usefixtures("pyarrow_xfail")
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/parser/common/test_ints.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import pandas._testing as tm

pytestmark = pytest.mark.filterwarnings(
"ignore:Passing a BlockManager to DataFrame:FutureWarning"
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
)

xfail_pyarrow = pytest.mark.usefixtures("pyarrow_xfail")
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/parser/common/test_iterator.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import pandas._testing as tm

pytestmark = pytest.mark.filterwarnings(
"ignore:Passing a BlockManager to DataFrame:FutureWarning"
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
)


Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/parser/dtypes/test_categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import pandas._testing as tm

pytestmark = pytest.mark.filterwarnings(
"ignore:Passing a BlockManager to DataFrame:FutureWarning"
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
)

xfail_pyarrow = pytest.mark.usefixtures("pyarrow_xfail")
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/parser/dtypes/test_dtypes_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
)

pytestmark = pytest.mark.filterwarnings(
"ignore:Passing a BlockManager to DataFrame:FutureWarning"
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
)


Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/parser/test_compression.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import pandas._testing as tm

pytestmark = pytest.mark.filterwarnings(
"ignore:Passing a BlockManager to DataFrame:FutureWarning"
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
)


Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/parser/test_dialect.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import pandas._testing as tm

pytestmark = pytest.mark.filterwarnings(
"ignore:Passing a BlockManager to DataFrame:FutureWarning"
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
)


Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/parser/test_encoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import pandas._testing as tm

pytestmark = pytest.mark.filterwarnings(
"ignore:Passing a BlockManager to DataFrame:FutureWarning"
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
)

skip_pyarrow = pytest.mark.usefixtures("pyarrow_skip")
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/parser/test_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import pandas._testing as tm

pytestmark = pytest.mark.filterwarnings(
"ignore:Passing a BlockManager to DataFrame:FutureWarning"
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
)

xfail_pyarrow = pytest.mark.usefixtures("pyarrow_xfail")
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/parser/test_index_col.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import pandas._testing as tm

pytestmark = pytest.mark.filterwarnings(
"ignore:Passing a BlockManager to DataFrame:FutureWarning"
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
)

xfail_pyarrow = pytest.mark.usefixtures("pyarrow_xfail")
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/parser/test_mangle_dupes.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@


pytestmark = pytest.mark.filterwarnings(
"ignore:Passing a BlockManager to DataFrame:FutureWarning"
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
)


Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/parser/test_na_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import pandas._testing as tm

pytestmark = pytest.mark.filterwarnings(
"ignore:Passing a BlockManager to DataFrame:FutureWarning"
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
)

xfail_pyarrow = pytest.mark.usefixtures("pyarrow_xfail")
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/parser/test_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from pandas.io.parsers import read_csv

pytestmark = pytest.mark.filterwarnings(
"ignore:Passing a BlockManager to DataFrame:FutureWarning"
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
)


Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/parser/test_parse_dates.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from pandas.io.parsers import read_csv

pytestmark = pytest.mark.filterwarnings(
"ignore:Passing a BlockManager to DataFrame:FutureWarning"
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
)

xfail_pyarrow = pytest.mark.usefixtures("pyarrow_xfail")
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/parser/test_quoting.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import pandas._testing as tm

pytestmark = pytest.mark.filterwarnings(
"ignore:Passing a BlockManager to DataFrame:FutureWarning"
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
)
xfail_pyarrow = pytest.mark.usefixtures("pyarrow_xfail")
skip_pyarrow = pytest.mark.usefixtures("pyarrow_skip")
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/parser/test_skiprows.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

xfail_pyarrow = pytest.mark.usefixtures("pyarrow_xfail")
pytestmark = pytest.mark.filterwarnings(
"ignore:Passing a BlockManager to DataFrame:FutureWarning"
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
)


Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/parser/test_unsupported.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import pandas.io.parsers.readers as parsers

pytestmark = pytest.mark.filterwarnings(
"ignore:Passing a BlockManager to DataFrame:FutureWarning"
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
)


Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/parser/usecols/test_parse_dates.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import pandas._testing as tm

pytestmark = pytest.mark.filterwarnings(
"ignore:Passing a BlockManager to DataFrame:FutureWarning"
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
)
xfail_pyarrow = pytest.mark.usefixtures("pyarrow_xfail")
skip_pyarrow = pytest.mark.usefixtures("pyarrow_skip")
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/parser/usecols/test_strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import pandas._testing as tm

pytestmark = pytest.mark.filterwarnings(
"ignore:Passing a BlockManager to DataFrame:FutureWarning"
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
)


Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/io/parser/usecols/test_usecols_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import pandas._testing as tm

pytestmark = pytest.mark.filterwarnings(
"ignore:Passing a BlockManager to DataFrame:FutureWarning"
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
)

_msg_validate_usecols_arg = (
Expand All @@ -38,7 +38,7 @@
skip_pyarrow = pytest.mark.usefixtures("pyarrow_skip")

pytestmark = pytest.mark.filterwarnings(
"ignore:Passing a BlockManager to DataFrame is deprecated:FutureWarning"
"ignore:Passing a BlockManager to DataFrame is deprecated:DeprecationWarning"
)


Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import pandas.io.common as icom

pytestmark = pytest.mark.filterwarnings(
"ignore:Passing a BlockManager to DataFrame:FutureWarning"
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
)


Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/test_feather.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from pandas.io.feather_format import read_feather, to_feather # isort:skip

pytestmark = pytest.mark.filterwarnings(
"ignore:Passing a BlockManager to DataFrame:FutureWarning"
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
)

pa = pytest.importorskip("pyarrow")
Expand Down
Loading

0 comments on commit 582c6bc

Please sign in to comment.