resolve deprecation warning about serialize_for_cli() #303
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In recent versions of
dask
anddistributed
, some utility functions were moved fromdistributed
todask
.For example, if you use
dask=2021.7.2
,distributed=20121.7.2
, anddask-cloudprovider=2021.6.0
, you will see the following warning.This can be reproduced with the following (run from anywhere except the root of this repo), for example:
This PR proposes a change to suppress that warning and to protect future releases of
dask-cloudprovider
from being broken whenserialize_for_cli()
is eventually removed fromdistributed
.How I tested this
I used
FargateCluster
withdask=2021.7.2
anddistributed=2021.7.2
to test these changes. Confirmed that after this change, the following code does not raise the deprecation warning, that it creates the cluster successfully, and that a small task like creating and taking the mean of a Dask array is successfully run out on the cluster.I also ran
git grep -E "distributed.*utils"
to check for other things that have been moved, annd didn't see any other that needed to be addressed.Notes for Reviewers
I'm proposing introduce this
_compat
layer with conditional imports so thatdask-cloudprovider
doesn't have to bump its version floor ondistributed
ordask
.Thanks for your time and consideration.