Skip to content

Stricter warnings filter#12274

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

Stricter warnings filter#12274
crusaderky merged 5 commits intodask:mainfrom
crusaderky:warn-error

Conversation

@crusaderky
Copy link
Copy Markdown
Collaborator

@crusaderky crusaderky commented Feb 4, 2026

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
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 4, 2026

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
"error:::dask[.*]",
"error:::pandas[.*]",
"error:::numpy[.*]",
"error:::distributed[.*]",
Copy link
Copy Markdown
Collaborator Author

@crusaderky crusaderky Feb 5, 2026

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
Copy link
Copy Markdown
Collaborator Author

@crusaderky crusaderky Feb 5, 2026

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
Copy link
Copy Markdown
Member

@jsignell jsignell left a comment

Choose a reason for hiding this comment

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

LGTM

"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.

'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
30 checks passed
@crusaderky crusaderky deleted the warn-error branch March 6, 2026 14:10
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

3 participants