Skip to content

Commit

Permalink
Backport PR pandas-dev#56615: CI: Fix deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
phofl authored and meeseeksmachine committed Dec 25, 2023
1 parent b59e594 commit e9130eb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
5 changes: 3 additions & 2 deletions pandas/tests/io/parser/common/test_chunksize.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def test_chunks_have_consistent_numerical_type(all_parsers, monkeypatch):
warn = None
if parser.engine == "pyarrow":
warn = DeprecationWarning
depr_msg = "Passing a BlockManager to DataFrame"
depr_msg = "Passing a BlockManager to DataFrame|make_block is deprecated"
with tm.assert_produces_warning(warn, match=depr_msg, check_stacklevel=False):
with monkeypatch.context() as m:
m.setattr(libparsers, "DEFAULT_BUFFER_HEURISTIC", heuristic)
Expand Down Expand Up @@ -254,7 +254,8 @@ def test_warn_if_chunks_have_mismatched_type(all_parsers):
if parser.engine == "pyarrow":
df = parser.read_csv_check_warnings(
DeprecationWarning,
"Passing a BlockManager to DataFrame is deprecated",
"Passing a BlockManager to DataFrame is deprecated|"
"make_block is deprecated",
buf,
check_stacklevel=False,
)
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/parser/common/test_read_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def test_suppress_error_output(all_parsers):
warn = None
if parser.engine == "pyarrow":
warn = DeprecationWarning
msg = "Passing a BlockManager to DataFrame"
msg = "Passing a BlockManager to DataFrame|make_block is deprecated"

with tm.assert_produces_warning(warn, match=msg, check_stacklevel=False):
result = parser.read_csv(StringIO(data), on_bad_lines="skip")
Expand Down
4 changes: 1 addition & 3 deletions pandas/tests/io/test_parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -1000,9 +1000,7 @@ def test_filter_row_groups(self, pa):
df = pd.DataFrame({"a": list(range(3))})
with tm.ensure_clean() as path:
df.to_parquet(path, engine=pa)
result = read_parquet(
path, pa, filters=[("a", "==", 0)], use_legacy_dataset=False
)
result = read_parquet(path, pa, filters=[("a", "==", 0)])
assert len(result) == 1

def test_read_parquet_manager(self, pa, using_array_manager):
Expand Down

0 comments on commit e9130eb

Please sign in to comment.