Skip to content

Implicit dask import 4164 #4318

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

Merged
merged 3 commits into from
Aug 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ New Features

Bug fixes
~~~~~~~~~
- Fixed a bug in backend caused by basic installation of Dask (:issue:`4164`, :pull:`4318`)
`Sam Morley <https://github.com/inakleinbottle>`_.


Documentation
Expand Down
9 changes: 6 additions & 3 deletions xarray/backends/locks.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,15 @@ def _get_scheduler(get=None, collection=None) -> Optional[str]:
dask.base.get_scheduler
"""
try:
import dask # noqa: F401
# Fix for bug caused by dask installation that doesn't involve the toolz library
# Issue: 4164
import dask
from dask.base import get_scheduler # noqa: F401

actual_get = get_scheduler(get, collection)
except ImportError:
return None

actual_get = dask.base.get_scheduler(get, collection)

try:
from dask.distributed import Client

Expand Down