Skip to content

Pandas 3.1: use suffixes= instead of deprecated lsuffix/rsuffix in join - #12712

Merged
crusaderky merged 4 commits into
dask:mainfrom
crusaderky:fix/pandas-join-suffixes
Nov 12, 2026
Merged

crusaderky merged 4 commits into
dask:mainfrom
crusaderky:fix/pandas-join-suffixes

Conversation

@crusaderky

@crusaderky crusaderky commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Pandas 3.1 deprecates DataFrame.join(lsuffix=..., rsuffix=...) in favour of
DataFrame.join(suffixes=(...)), emitting Pandas4Warning.

This was triggered by

  • dask/dataframe/tests/test_multi.py::test_sequential_joins
  • dask/dataframe/tests/test_multi.py::test_join_by_index_patterns[disk|tasks-{inner,left,right,outer}]
  • dask/dataframe/tests/test_dataframe.py::test_join_series

The warnings come from the pandas reference frames in these tests, not from dask
internals: DataFrame.join in dask/dataframe/dask_expr/_collection.py already
forwards lsuffix/rsuffix as suffixes=(lsuffix, rsuffix) to merge.

pandas 4 deprecates DataFrame.join(lsuffix=..., rsuffix=...) in favour of
suffixes=(...). The pandas reference frames in these tests triggered
Pandas4Warning, which dask's filterwarnings=error turns into a failure.

The dask collection calls intentionally keep using dask's public
lsuffix/rsuffix keywords, so the tests still cover dask's mapping of
those keywords onto pandas' suffixes.
pandas added the `suffixes` keyword to `DataFrame.join` only in 3.1, at the
same time it deprecated `lsuffix`/`rsuffix`. Replacing the deprecated keywords
outright broke the tests on older pandas with
`TypeError: DataFrame.join() got an unexpected keyword argument 'suffixes'`.
Add a version-aware helper for the pandas expectations.
@crusaderky crusaderky changed the title [unsupervised AI] Use suffixes= instead of deprecated lsuffix/rsuffix in join tests Pandas 3.1: use suffixes= instead of deprecated lsuffix/rsuffix in join Nov 12, 2026
@crusaderky
crusaderky marked this pull request as ready for review November 12, 2026 15:13
@crusaderky
crusaderky merged commit 3b37a21 into dask:main Nov 12, 2026
29 of 32 checks passed
@crusaderky
crusaderky deleted the fix/pandas-join-suffixes branch November 12, 2026 15:13
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