You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently dask/dask doesn't depend directly on yaml, even though the config system uses it. This is because historically we wanted a minimal install (pip install dask) of just the core scheduler and graph routines (including optimization) to work with no dependencies.
This limitation means that in dask/dask, all dask.config.get calls need to also provide a default, since the default dask.yaml file may not be read in at all.
In practice this makes developing dask/dask using the config system complicated - the default values need to be stored in both the code and the config file. Further, the only test we have for this behavior (a minimal install that doesn't include yaml) runs on a cron job, no part of PRs. It also doesn't hit all cases - we've had long existing code paths that would break if yaml wasn't also present (e.g. https://github.com/dask/dask/blob/master/dask/array/core.py#L2543).
I'd like to propose that we make yaml a required dependency for dask/dask. This would make the minimal install no longer dependency-less, but I think at this point dependencies in the Python ecosystem are no longer as tricky to install as they were 5 years ago. At minimum, I think it should be required for all the collections (e.g dask.array), as that reduces the number of files where we need to test this behavior.
I agree with @TomAugspurger 's reaction that having it for anything on top of core Dask makes sense.
I don't have strong opinions on adding it as a core dependency. My gut reaction for and against are "I'm not sure that anyone cares about super-lightweight dependencies any longer" and "it's decently easy to add defaults in the core parts where we can't assume yaml" although presumably this came about because the latter gut reaction failed.
Since we don't have a test for it that runs on PRs, it's easy for these to slip through. I think since we're already struggling for developer bandwidth, making things harder by having two codepaths (one with yaml, one without) isn't worth it. If a user is using the distributed scheduler (many of our users) they'll already have it installed.
For what it's worth, I'd be strongly in favour. As a rule of thumb, I always prefer to make all small and pure-python dependencies mandatory in order to reduce the number of degrees of freedom that need to be covered by testing. Don't ship what you don't test.
fwiw again, the lack of pyyaml dependency broke CI for both napari and scikit-image with 2.17 with the "KeyError: 'optimization'" error first reported in #6198 (comment)
Looking at the references piling up there we are not exceptions! 😬
I don't find any of the arguments for keeping pip install dask dependency free compelling enough to not make yaml a core dependency here. Since most users will also have distributed installed (which requires yaml), and it's hard for us as developers to ensure this (we don't currently test for it on PRs), and it's a restriction that's easy to forget, I think we should do the easy thing and just make it a dependency.
Just to add another datapoint to the discussion, we're seeing the "KeyError: 'optimization'" error in our CI as well in some code that uses xarray. Are there any plans to push a patch for 2.17?
Activity
jcrist commentedon May 18, 2020
This is causing some current test failures, so I'd like to reach a resolution mildly quickly. cc @mrocklin, @TomAugspurger, @jrbourbeau for thoughts.
TomAugspurger commentedon May 18, 2020
mrocklin commentedon May 18, 2020
I agree with @TomAugspurger 's reaction that having it for anything on top of core Dask makes sense.
I don't have strong opinions on adding it as a core dependency. My gut reaction for and against are "I'm not sure that anyone cares about super-lightweight dependencies any longer" and "it's decently easy to add defaults in the core parts where we can't assume yaml" although presumably this came about because the latter gut reaction failed.
jcrist commentedon May 18, 2020
Since we don't have a test for it that runs on PRs, it's easy for these to slip through. I think since we're already struggling for developer bandwidth, making things harder by having two codepaths (one with yaml, one without) isn't worth it. If a user is using the distributed scheduler (many of our users) they'll already have it installed.
crusaderky commentedon May 18, 2020
For what it's worth, I'd be strongly in favour. As a rule of thumb, I always prefer to make all small and pure-python dependencies mandatory in order to reduce the number of degrees of freedom that need to be covered by testing. Don't ship what you don't test.
Depend on yaml
jni commentedon May 27, 2020
fwiw again, the lack of pyyaml dependency broke CI for both napari and scikit-image with 2.17 with the "KeyError: 'optimization'" error first reported in #6198 (comment)
Looking at the references piling up there we are not exceptions! 😬
jcrist commentedon May 27, 2020
I don't find any of the arguments for keeping
pip install daskdependency free compelling enough to not make yaml a core dependency here. Since most users will also havedistributedinstalled (which requiresyaml), and it's hard for us as developers to ensure this (we don't currently test for it on PRs), and it's a restriction that's easy to forget, I think we should do the easy thing and just make it a dependency.I'll push a PR up now.
quaterneon commentedon May 27, 2020
Just to add another datapoint to the discussion, we're seeing the "KeyError: 'optimization'" error in our CI as well in some code that uses xarray. Are there any plans to push a patch for 2.17?
jcrist commentedon May 27, 2020
This would result in a new point release, yes.