Skip to content

Silence deprecations in global config if local config overrides them#12315

Merged
jacobtomlinson merged 4 commits intodask:mainfrom
crusaderky:merge-deprecations
Mar 12, 2026
Merged

Silence deprecations in global config if local config overrides them#12315
jacobtomlinson merged 4 commits intodask:mainfrom
crusaderky:merge-deprecations

Conversation

@crusaderky
Copy link
Copy Markdown
Collaborator

@crusaderky crusaderky commented Mar 6, 2026

Add support for corporate deployments where the root user installed an old version of Dask, with an associated /etc/dask/dask.yaml, e.g.

distributed:
   p2p:
     disk: false

while the local user deployed a newer version of dask in a local environment with its own config, e.g. ~/.config/dask/dask.yaml

distributed:
   p2p:
     storage:
        disk: false

In this use case, suppress the warning that the legacy config contains a deprecated key, as it's been explicitly overwritten by the local config.

In case of deleted keys: keep raising ValueError when the user sets a deprecated key (with no valid replacement) with dask.config.set, but just emit a warning if the obsolete key is in a config file. Also offer the user to override the config file, as they may be unable to directly modify the offending file due to permissions, as explained above.

(At the moment of writing there aren't any deleted keys in dask or distributed; not sure about third-party packages that piggy-back on the same config system).

update(config, d, priority="old")

update(config, collect(**kwargs))
rename(deprecations, config)
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.

defaults are already tested with the schema so it should not be relevant to test them again for deprecations?

@crusaderky crusaderky marked this pull request as draft March 6, 2026 18:19
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 6, 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 37m 6s ⏱️ + 5m 53s
 18 293 tests + 4   17 019 ✅ + 4   1 274 💤 ± 0  0 ❌ ±0 
317 388 runs  +84  273 625 ✅ +74  43 763 💤 +10  0 ❌ ±0 

Results for commit 7bf5d89. ± Comparison against base commit 8a9b92f.

♻️ This comment has been updated with latest results.

@crusaderky crusaderky marked this pull request as ready for review March 7, 2026 08:27
@jacobtomlinson
Copy link
Copy Markdown
Member

cc @djhoese

@djhoese
Copy link
Copy Markdown
Contributor

djhoese commented Mar 10, 2026

Thanks for the mention so I can include these in the donfig package. It looks like I missed a couple older PRs that I'll need to apply first (#10499, #10521).

@crusaderky
Copy link
Copy Markdown
Collaborator Author

I will merge later this week if there are no objections

Copy link
Copy Markdown
Member

@jacobtomlinson jacobtomlinson left a comment

Choose a reason for hiding this comment

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

Overall this looks fine.

Could you make sure this is covered in the configuration documentation? Especially the ignore-deprecated option.

@crusaderky
Copy link
Copy Markdown
Collaborator Author

Overall this looks fine.

Could you make sure this is covered in the configuration documentation? Especially the ignore-deprecated option.

Done

Copy link
Copy Markdown
Member

@jacobtomlinson jacobtomlinson left a comment

Choose a reason for hiding this comment

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

Looks great thanks!

@jacobtomlinson jacobtomlinson merged commit 0d40a60 into dask:main Mar 12, 2026
29 checks passed
@crusaderky crusaderky deleted the merge-deprecations branch March 12, 2026 13:04
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.

3 participants