Skip to content

Commit d5dbc26

Browse files
committed
Update make_block's warning
1 parent 9f2d569 commit d5dbc26

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

pandas/core/internals/api.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import numpy as np
1616

1717
from pandas._libs.internals import BlockPlacement
18+
from pandas.util._exceptions import Pandas40DeprecationWarning
1819

1920
from pandas.core.dtypes.common import pandas_dtype
2021
from pandas.core.dtypes.dtypes import (
@@ -93,7 +94,7 @@ def make_block(
9394
"make_block is deprecated and will be removed in a future version. "
9495
"Use pd.api.internals.create_dataframe_from_blocks or "
9596
"(recommended) higher-level public APIs instead.",
96-
DeprecationWarning,
97+
Pandas40DeprecationWarning,
9798
stacklevel=2,
9899
)
99100

pandas/io/feather_format.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from pandas._libs import lib
1414
from pandas.compat._optional import import_optional_dependency
1515
from pandas.util._decorators import doc
16+
from pandas.util._exceptions import Pandas40DeprecationWarning
1617
from pandas.util._validators import check_dtype_backend
1718

1819
import pandas as pd
@@ -136,7 +137,7 @@ def read_feather(
136137
warnings.filterwarnings(
137138
"ignore",
138139
"make_block is deprecated",
139-
DeprecationWarning,
140+
Pandas40DeprecationWarning,
140141
)
141142

142143
return feather.read_feather(

pandas/io/parquet.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from pandas.compat._optional import import_optional_dependency
2222
from pandas.errors import AbstractMethodError
2323
from pandas.util._decorators import doc
24+
from pandas.util._exceptions import Pandas40DeprecationWarning
2425
from pandas.util._validators import check_dtype_backend
2526

2627
import pandas as pd
@@ -278,7 +279,7 @@ def read(
278279
filterwarnings(
279280
"ignore",
280281
"make_block is deprecated",
281-
DeprecationWarning,
282+
Pandas40DeprecationWarning,
282283
)
283284
result = pa_table.to_pandas(**to_pandas_kwargs)
284285

@@ -397,7 +398,7 @@ def read(
397398
filterwarnings(
398399
"ignore",
399400
"make_block is deprecated",
400-
DeprecationWarning,
401+
Pandas40DeprecationWarning,
401402
)
402403
return parquet_file.to_pandas(
403404
columns=columns, filters=filters, **kwargs

pandas/io/parsers/arrow_parser_wrapper.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
ParserError,
1212
ParserWarning,
1313
)
14-
from pandas.util._exceptions import find_stack_level
14+
from pandas.util._exceptions import (
15+
Pandas40DeprecationWarning,
16+
find_stack_level,
17+
)
1518

1619
from pandas.core.dtypes.common import pandas_dtype
1720
from pandas.core.dtypes.inference import is_integer
@@ -291,7 +294,7 @@ def read(self) -> DataFrame:
291294
warnings.filterwarnings(
292295
"ignore",
293296
"make_block is deprecated",
294-
DeprecationWarning,
297+
Pandas40DeprecationWarning,
295298
)
296299
if dtype_backend == "pyarrow":
297300
frame = table.to_pandas(types_mapper=pd.ArrowDtype)

0 commit comments

Comments
 (0)