Skip to content

Pandas 3.1: Stop using the deprecated inplace= keyword in parquet - #12714

Merged
crusaderky merged 1 commit into
dask:mainfrom
crusaderky:fix/pandas-inplace-deprecation
Nov 12, 2026
Merged

crusaderky merged 1 commit into
dask:mainfrom
crusaderky:fix/pandas-inplace-deprecation

Conversation

@crusaderky

@crusaderky crusaderky commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Pandas 3.1 deprecates the inplace keyword in a number of DataFrame methods
(PDEP-8),
emitting pandas.errors.Pandas4Warning.

The pyarrow parquet engine is by far the largest source of these failures:

  • ArrowDatasetEngine._write_partitioned — reset_index / set_index
  • ArrowDatasetEngine.write_partition — set_index
  • ArrowDatasetEngine._create_dd_meta — reset_index / set_index

Two test helpers had the same problem: _drop_mean in dask/dataframe/tests/test_dataframe.py and dask/dataframe/dask_expr/tests/test_describe.py used df.dropna(how="all", inplace=True), and test_read_parquet_custom_columns used df2.sort_values(..., inplace=True).

The An error occurred while calling the read_parquet method registered to the pandas backend failures are the same warning re-raised with a prefix by BackendEntrypoint.register_inplace.

pandas 3.1 deprecates the `inplace` keyword in DataFrame.set_index,
DataFrame.reset_index, DataFrame.dropna and DataFrame.sort_values
(pandas.errors.Pandas4Warning, PDEP-8). dask's test suite turns warnings
into errors, so every code path touching pyarrow parquet metadata or
partition handling fails on pandas 3.1.

Replace `inplace=True` with explicit reassignment. The deprecated keyword
still works on pandas 2.x, so this is backwards compatible and behaves
identically.
@github-actions

Copy link
Copy Markdown
Contributor

Unit Test Results

See test report for an extended history of previous test failures. This is useful for diagnosing flaky tests.

     25 files  ±0       25 suites  ±0   6h 59m 21s ⏱️ + 6m 43s
 19 914 tests ±0   18 481 ✅ +1   1 433 💤 ±0  0 ❌  - 1 
379 353 runs  ±0  332 079 ✅  - 5  47 274 💤 +6  0 ❌  - 1 

Results for commit 6b4f353. ± Comparison against base commit b4cc5c5.

@crusaderky crusaderky changed the title [unsupervised AI] Stop using the deprecated inplace= keyword in the parquet read path Pandas 3.1: Stop using the deprecated inplace= keyword in parquet Nov 12, 2026
@crusaderky
crusaderky marked this pull request as ready for review November 12, 2026 15:16
@crusaderky
crusaderky merged commit 48a00bc into dask:main Nov 12, 2026
33 of 35 checks passed
@crusaderky
crusaderky deleted the fix/pandas-inplace-deprecation branch November 12, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant