Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wrong unpickling with dask 2024.11 #1993

Merged
merged 4 commits into from
Nov 12, 2024
Merged

Fix wrong unpickling with dask 2024.11 #1993

merged 4 commits into from
Nov 12, 2024

Conversation

aulemahal
Copy link
Collaborator

Pull Request Checklist:

  • This PR addresses an already opened issue (for bug fixes / features)
  • Tests for the changes have been added (for bug fixes / features)
    • (If applicable) Documentation has been added / updated (for bug fixes / features)
  • CHANGELOG.rst has been updated (with summary of main changes)
    • Link to issue (:issue:number) and pull request (:pull:number) has been added

What kind of change does this PR introduce?

The issue introduced with dask 2024.11 concerned the passing of arguments through the dask graph. Most SDBA classes are children of Parametrizable, itself a child of dict. When stored in the graph, objects like this are pickled. and then repickled when the function is actually executed.

For some reason, the repickling stopped working and objects where reinstated as dictionaries instead of their subclasses. This particularly touched the Grouper, one of the only such objects actually been passed through dask-backed computations.

Inheriting from dict was once not recommended but I think this is not the case anymore. Anyway, I found that inheriting from collections.UserDict actually solved the issue (after adapting the internals). Not sure if I should raise the issue back to dask...

Does this PR introduce a breaking change?

I changed how all classes of xclim.sdba are made, but in theory the change is at a low, private level.

Other information:

@aulemahal aulemahal requested a review from Zeitsperre November 11, 2024 22:30
@github-actions github-actions bot added the sdba Issues concerning the sdba submodule. label Nov 11, 2024
@Zeitsperre Zeitsperre added this to the v0.54.0 milestone Nov 12, 2024
Copy link
Collaborator

@Zeitsperre Zeitsperre left a comment

Choose a reason for hiding this comment

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

LGTM

CHANGELOG.rst Outdated Show resolved Hide resolved
CHANGELOG.rst Outdated Show resolved Hide resolved
@github-actions github-actions bot added the approved Approved for additional tests label Nov 12, 2024
Co-authored-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
@coveralls
Copy link

coveralls commented Nov 12, 2024

Coverage Status

coverage: 89.398%. remained the same
when pulling 58f0fb3 on fix-dask-2024-11
into e0a0c88 on main.

@Zeitsperre Zeitsperre merged commit 445aefb into main Nov 12, 2024
21 checks passed
@Zeitsperre Zeitsperre deleted the fix-dask-2024-11 branch November 12, 2024 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Approved for additional tests sdba Issues concerning the sdba submodule.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SDBA tools failing with dask>=2024.11
3 participants