Skip to content

Stricter warnings filter - #12274

Merged
crusaderky merged 5 commits into
dask:mainfrom
crusaderky:warn-error
Mar 4, 2026
Merged

crusaderky merged 5 commits into
dask:mainfrom
crusaderky:warn-error

Conversation

@crusaderky

@crusaderky crusaderky commented Feb 4, 2026 •

Copy link
Copy Markdown
Collaborator

Revisit filterwarnings in pyproject.toml to be stricter, causing a hard error on all unexpected warnings.

This PR was prompted by noticing that Pandas4Warning's do not always cause a hard error in the test suite, whereas reading pyproject.toml would suggest the opposite. Also in the past (#12052) there were several deprecations that were uncaught until they finally broke.

This PR builds on top of

and should be merged after them. Please only look at the last commit.

@crusaderky
crusaderky force-pushed the warn-error branch 2 times, most recently from adbc918 to 294ec62 Compare February 4, 2026 18:55
@github-actions

github-actions Bot commented Feb 4, 2026 •

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.

     21 files  ±0       21 suites  ±0   5h 34m 2s ⏱️ + 4m 13s
 18 288 tests ±0   17 014 ✅ +1   1 274 💤 ±0  0 ❌  - 1 
317 287 runs  ±0  273 537 ✅  - 3  43 750 💤 +4  0 ❌  - 1 

Results for commit 6d8bd67. ± Comparison against base commit ac02b7d.

♻️ This comment has been updated with latest results.

@crusaderky
crusaderky force-pushed the warn-error branch 3 times, most recently from 1d8b834 to 066e34f Compare February 5, 2026 14:40
@crusaderky
crusaderky marked this pull request as ready for review February 5, 2026 14:42
Comment thread pyproject.toml
"error:::dask[.*]",
"error:::pandas[.*]",
"error:::numpy[.*]",
"error:::distributed[.*]",

@crusaderky crusaderky Feb 5, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To my understanding, the intention here was to avoid having to explicitly suppress warnings caused by third-party libraries.
However, I've observed quite a few cases of uncaught Pandas4Warning that were definitely of dask's compentence, e.g. #12272.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that this converts any warning from dask, pandas, numpy, distributed to an error. So it's the opposite of suppressing. But I think having all warnings error like you have in the PR is also fine.

- scipy=1.7.2
- scikit-learn=1.0.2
- scipy=1.10.0
- setuptools=60

@crusaderky crusaderky Feb 5, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are three different deprecation warnings re. distutils on

  • setuptools <60,
  • setuptools >=60,<81,
  • setuptools >=81

@crusaderky
crusaderky force-pushed the warn-error branch 2 times, most recently from 59e2d83 to 636e77d Compare February 5, 2026 23:27
@crusaderky
crusaderky force-pushed the warn-error branch 2 times, most recently from 684135b to 788578c Compare February 13, 2026 09:01
@crusaderky
crusaderky marked this pull request as draft February 13, 2026 09:56
@crusaderky
crusaderky marked this pull request as ready for review February 13, 2026 10:04
@crusaderky

Copy link
Copy Markdown
Collaborator Author

@jsignell Would you have time to review this?

@crusaderky
crusaderky requested a review from jsignell March 2, 2026 11:55

@jsignell jsignell left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread pyproject.toml
"error:::dask[.*]",
"error:::pandas[.*]",
"error:::numpy[.*]",
"error:::distributed[.*]",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that this converts any warning from dask, pandas, numpy, distributed to an error. So it's the opposite of suppressing. But I think having all warnings error like you have in the PR is also fine.

Comment thread pyproject.toml
'ignore:The previous implementation of stack is deprecated and will be removed in a future version of pandas\.:FutureWarning',
"ignore:distutils Version classes are deprecated. Use packaging.version instead.:DeprecationWarning",
# FIXME spurious shutdown of distributed workers and/or sqlite3
"module:Exception ignored:pytest.PytestUnraisableExceptionWarning::",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems weird to ignore pytest warnings. Is the plan to fix these when there is more maintenance time available?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, these need to be looked at eventually.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you open an issue to track this?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@crusaderky

Copy link
Copy Markdown
Collaborator Author

My understanding is that this converts any warning from dask, pandas, numpy, distributed to an error.

That was my naive understanding as well, but it resulted in a big bunch of Pandas4Warning to remain suppressed, so there must be something wrong with that logic.
Rather than try to make it work, I decided it was healthier to go nuclear and just error on everything not explicitly suppressed.

@crusaderky
crusaderky merged commit e0529bb into dask:main Mar 4, 2026
29 checks passed
@crusaderky
crusaderky deleted the warn-error branch March 6, 2026 14:10
@QuLogic

QuLogic commented May 4, 2026

Copy link
Copy Markdown
Contributor

It appears that several of these warning still occur and are not filtered out in a more specific setting:

FAILED dask/dataframe/io/tests/test_csv.py::test_read_csv_groupby_get_group - FutureWarning: When grouping with a length-1 list-like, you will need to pa...
FAILED dask/dataframe/dask_expr/tests/test_groupby.py::test_groupby_cov[cov-True] - FutureWarning: The previous implementation of stack is deprecated and will ...
FAILED dask/dataframe/dask_expr/tests/test_groupby.py::test_groupby_cov[cov-False] - FutureWarning: The previous implementation of stack is deprecated and will ...
FAILED dask/dataframe/dask_expr/tests/test_groupby.py::test_groupby_cov[corr-True] - FutureWarning: The previous implementation of stack is deprecated and will ...
FAILED dask/dataframe/dask_expr/tests/test_groupby.py::test_groupby_cov[corr-False] - FutureWarning: The previous implementation of stack is deprecated and will ...
FAILED dask/dataframe/dask_expr/tests/test_groupby.py::test_groupby_apply_args - FutureWarning: DataFrameGroupBy.apply operated on the grouping columns. Thi...
FAILED dask/dataframe/dask_expr/tests/test_groupby.py::test_get_group[<lambda>0] - FutureWarning: When grouping with a length-1 list-like, you will need to pa...
FAILED dask/dataframe/dask_expr/tests/test_groupby.py::test_get_group[<lambda>1] - FutureWarning: When grouping with a length-1 list-like, you will need to pa...
FAILED dask/dataframe/dask_expr/tests/test_groupby.py::test_get_group[<lambda>2] - FutureWarning: When grouping with a length-1 list-like, you will need to pa...
FAILED dask/dataframe/tests/test_groupby.py::test_apply_or_transform_shuffle[tasks-<lambda>1-<lambda>0] - FutureWarning: DataFrameGroupBy.apply operated on the grouping columns. Thi...
FAILED dask/dataframe/tests/test_groupby.py::test_apply_or_transform_shuffle[tasks-<lambda>1-<lambda>1] - FutureWarning: DataFrameGroupBy.apply operated on the grouping columns. Thi...
FAILED dask/dataframe/tests/test_groupby.py::test_apply_or_transform_shuffle_multilevel[disk-<lambda>1-<lambda>0] - FutureWarning: DataFrameGroupBy.apply operated on the grouping columns. Thi...
FAILED dask/dataframe/tests/test_groupby.py::test_apply_or_transform_shuffle_multilevel[disk-<lambda>1-<lambda>1] - FutureWarning: DataFrameGroupBy.apply operated on the grouping columns. Thi...
FAILED dask/dataframe/tests/test_groupby.py::test_apply_or_transform_shuffle_multilevel[disk-<lambda>1-<lambda>2] - FutureWarning: DataFrameGroupBy.apply operated on the grouping columns. Thi...
FAILED dask/dataframe/tests/test_groupby.py::test_apply_or_transform_shuffle_multilevel[disk-<lambda>1-<lambda>3] - FutureWarning: DataFrameGroupBy.apply operated on the grouping columns. Thi...
FAILED dask/dataframe/tests/test_groupby.py::test_apply_or_transform_shuffle_multilevel[tasks-<lambda>1-<lambda>0] - FutureWarning: DataFrameGroupBy.apply operated on the grouping columns. Thi...
FAILED dask/dataframe/tests/test_groupby.py::test_apply_or_transform_shuffle_multilevel[tasks-<lambda>1-<lambda>1] - FutureWarning: DataFrameGroupBy.apply operated on the grouping columns. Thi...
FAILED dask/dataframe/tests/test_groupby.py::test_apply_or_transform_shuffle_multilevel[tasks-<lambda>1-<lambda>2] - FutureWarning: DataFrameGroupBy.apply operated on the grouping columns. Thi...
FAILED dask/dataframe/tests/test_groupby.py::test_apply_or_transform_shuffle_multilevel[tasks-<lambda>1-<lambda>3] - FutureWarning: DataFrameGroupBy.apply operated on the grouping columns. Thi...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_get_group[disk-True-<lambda>0] - FutureWarning: When grouping with a length-1 list-like, you will need to pa...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_get_group[disk-False-<lambda>0] - FutureWarning: When grouping with a length-1 list-like, you will need to pa...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_get_group[disk-True-<lambda>1] - FutureWarning: When grouping with a length-1 list-like, you will need to pa...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_get_group[disk-False-<lambda>1] - FutureWarning: When grouping with a length-1 list-like, you will need to pa...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_get_group[disk-False-<lambda>2] - FutureWarning: When grouping with a length-1 list-like, you will need to pa...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_get_group[tasks-True-<lambda>0] - FutureWarning: When grouping with a length-1 list-like, you will need to pa...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_get_group[tasks-False-<lambda>0] - FutureWarning: When grouping with a length-1 list-like, you will need to pa...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_get_group[tasks-True-<lambda>1] - FutureWarning: When grouping with a length-1 list-like, you will need to pa...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_get_group[tasks-False-<lambda>1] - FutureWarning: When grouping with a length-1 list-like, you will need to pa...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_get_group[tasks-False-<lambda>2] - FutureWarning: When grouping with a length-1 list-like, you will need to pa...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_numeric_only_false_cov_corr[disk-cov] - FutureWarning: The previous implementation of stack is deprecated and will ...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_numeric_only_false_cov_corr[disk-corr] - FutureWarning: The previous implementation of stack is deprecated and will ...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_numeric_only_false_cov_corr[tasks-cov] - FutureWarning: The previous implementation of stack is deprecated and will ...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_numeric_only_false_cov_corr[tasks-corr] - FutureWarning: The previous implementation of stack is deprecated and will ...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_cov_non_numeric_grouping_column[disk] - FutureWarning: The previous implementation of stack is deprecated and will ...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_cov_non_numeric_grouping_column[tasks] - FutureWarning: The previous implementation of stack is deprecated and will ...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_numeric_only_true[disk-corr] - FutureWarning: The previous implementation of stack is deprecated and will ...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_numeric_only_true[disk-cov] - FutureWarning: The previous implementation of stack is deprecated and will ...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_numeric_only_true[tasks-corr] - FutureWarning: The previous implementation of stack is deprecated and will ...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_numeric_only_true[tasks-cov] - FutureWarning: The previous implementation of stack is deprecated and will ...
FAILED dask/dataframe/tests/test_groupby.py::test_apply_or_transform_shuffle[disk-<lambda>1-<lambda>0] - FutureWarning: DataFrameGroupBy.apply operated on the grouping columns. Thi...
FAILED dask/dataframe/tests/test_groupby.py::test_apply_or_transform_shuffle[disk-<lambda>1-<lambda>1] - FutureWarning: DataFrameGroupBy.apply operated on the grouping columns. Thi...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_unaligned_index[disk] - FutureWarning: When grouping with a length-1 list-like, you will need to pa...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_unaligned_index[tasks] - FutureWarning: When grouping with a length-1 list-like, you will need to pa...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_string_label[disk] - FutureWarning: When grouping with a length-1 list-like, you will need to pa...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_string_label[tasks] - FutureWarning: When grouping with a length-1 list-like, you will need to pa...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_cov[disk-columns0] - FutureWarning: The previous implementation of stack is deprecated and will ...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_cov[disk-columns1] - FutureWarning: The previous implementation of stack is deprecated and will ...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_cov[disk-columns2] - FutureWarning: The previous implementation of stack is deprecated and will ...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_cov[disk-columns3] - FutureWarning: The previous implementation of stack is deprecated and will ...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_cov[tasks-columns0] - FutureWarning: The previous implementation of stack is deprecated and will ...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_cov[tasks-columns1] - FutureWarning: The previous implementation of stack is deprecated and will ...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_cov[tasks-columns2] - FutureWarning: The previous implementation of stack is deprecated and will ...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_cov[tasks-columns3] - FutureWarning: The previous implementation of stack is deprecated and will ...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_transform_ufunc_partitioning[disk-not_indexed-3] - FutureWarning: DataFrameGroupBy.apply operated on the grouping columns. Thi...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_transform_ufunc_partitioning[disk-not_indexed-4] - FutureWarning: DataFrameGroupBy.apply operated on the grouping columns. Thi...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_transform_ufunc_partitioning[disk-not_indexed-5] - FutureWarning: DataFrameGroupBy.apply operated on the grouping columns. Thi...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_transform_ufunc_partitioning[disk-not_indexed-6] - FutureWarning: DataFrameGroupBy.apply operated on the grouping columns. Thi...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_transform_ufunc_partitioning[disk-not_indexed-7] - FutureWarning: DataFrameGroupBy.apply operated on the grouping columns. Thi...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_transform_ufunc_partitioning[disk-not_indexed-8] - FutureWarning: DataFrameGroupBy.apply operated on the grouping columns. Thi...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_transform_ufunc_partitioning[disk-not_indexed-9] - FutureWarning: DataFrameGroupBy.apply operated on the grouping columns. Thi...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_transform_ufunc_partitioning[tasks-not_indexed-3] - FutureWarning: DataFrameGroupBy.apply operated on the grouping columns. Thi...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_transform_ufunc_partitioning[tasks-not_indexed-4] - FutureWarning: DataFrameGroupBy.apply operated on the grouping columns. Thi...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_transform_ufunc_partitioning[tasks-not_indexed-5] - FutureWarning: DataFrameGroupBy.apply operated on the grouping columns. Thi...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_transform_ufunc_partitioning[tasks-not_indexed-6] - FutureWarning: DataFrameGroupBy.apply operated on the grouping columns. Thi...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_transform_ufunc_partitioning[tasks-not_indexed-7] - FutureWarning: DataFrameGroupBy.apply operated on the grouping columns. Thi...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_transform_ufunc_partitioning[tasks-not_indexed-8] - FutureWarning: DataFrameGroupBy.apply operated on the grouping columns. Thi...
FAILED dask/dataframe/tests/test_groupby.py::test_groupby_transform_ufunc_partitioning[tasks-not_indexed-9] - FutureWarning: DataFrameGroupBy.apply operated on the grouping columns. Thi...

@crusaderky

Copy link
Copy Markdown
Collaborator Author

@QuLogic if you're using pandas nightly, that's a known issue; see #12337
If you're only using stable versions of dependencies, could you investigate what is different between your environment and CI (which is all green for pandas 3.0.2)?

@QuLogic

QuLogic commented May 5, 2026

Copy link
Copy Markdown
Contributor

It's with Pandas 2.3.3; we don't yet have pandas 3 in Fedora, though it might happen soonish. But in any case, I can easily reproduce in a venv with pandas==2.3.3.

@crusaderky

Copy link
Copy Markdown
Collaborator Author

Moving to #12371

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.

Consider testing with fatal Python deprecations

4 participants