Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
6 changes: 6 additions & 0 deletions doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ New Features
``pip install git+https://github.com/andrewgsavage/pint.git@refs/pull/6/head)``.
Even with it, interaction with non-numpy array libraries, e.g. dask or sparse, is broken.

Bug fixes
~~~~~~~~~
- Fix regression introduced in v0.14.0 that would cause a crash if dask is installed
but cloudpickle isn't (:issue:`3401`) by `Rhys Doyle <https://github.com/rdoyle45>`_

Documentation
~~~~~~~~~~~~~

Expand All @@ -39,6 +44,7 @@ Documentation
datetime-like dimension is required. (:pull:`3400`)
By `Justus Magin <https://github.com/keewis>`_.


.. _whats-new.0.14.0:

v0.14.0 (14 Oct 2019)
Expand Down
16 changes: 10 additions & 6 deletions xarray/backends/locks.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import multiprocessing
import threading
import weakref
from typing import Any, MutableMapping
from typing import Any, MutableMapping, Optional

try:
from dask.utils import SerializableLock
Expand Down Expand Up @@ -62,7 +62,7 @@ def _get_lock_maker(scheduler=None):
return _LOCK_MAKERS[scheduler]


def _get_scheduler(get=None, collection=None):
def _get_scheduler(get=None, collection=None) -> Optional[str]:
"""Determine the dask scheduler that is being used.

None is returned if no dask scheduler is active.
Expand All @@ -86,10 +86,14 @@ def _get_scheduler(get=None, collection=None):
except (ImportError, AttributeError):
pass

if actual_get is dask.multiprocessing.get:
return "multiprocessing"
else:
return "threaded"
try:
# dask.multiprocessing requires cloudpickle to be installed
if actual_get is dask.multiprocessing.get:
return "multiprocessing"
except AttributeError:
pass

return "threaded"


def get_write_lock(key):
Expand Down