From 72e6df489e059c430d4ae22100caf74c0885df19 Mon Sep 17 00:00:00 2001 From: Sam Morley <41870650+inakleinbottle@users.noreply.github.com> Date: Thu, 6 Aug 2020 09:45:13 +0100 Subject: [PATCH 1/3] Fixed bug involving dask import --- xarray/backends/locks.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/xarray/backends/locks.py b/xarray/backends/locks.py index 435690f2079..2d1f2de652a 100644 --- a/xarray/backends/locks.py +++ b/xarray/backends/locks.py @@ -72,12 +72,14 @@ 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 From 517edd63401b134a196b894093fa08e69aaf1d1c Mon Sep 17 00:00:00 2001 From: Sam Morley <41870650+inakleinbottle@users.noreply.github.com> Date: Thu, 6 Aug 2020 09:49:35 +0100 Subject: [PATCH 2/3] Reformatting using black --- xarray/backends/locks.py | 1 + 1 file changed, 1 insertion(+) diff --git a/xarray/backends/locks.py b/xarray/backends/locks.py index 2d1f2de652a..bb876a432c8 100644 --- a/xarray/backends/locks.py +++ b/xarray/backends/locks.py @@ -76,6 +76,7 @@ def _get_scheduler(get=None, collection=None) -> Optional[str]: # Issue: 4164 import dask from dask.base import get_scheduler # noqa: F401 + actual_get = get_scheduler(get, collection) except ImportError: return None From 3711bc1e12f7149eecc8fd4688df24d184804ecf Mon Sep 17 00:00:00 2001 From: Sam Morley <41870650+inakleinbottle@users.noreply.github.com> Date: Thu, 6 Aug 2020 17:02:31 +0100 Subject: [PATCH 3/3] Added line to whats-new.rst --- doc/whats-new.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/whats-new.rst b/doc/whats-new.rst index 81ef2cd9e17..9f575027b4f 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -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 `_. Documentation