Skip to content

Commit e26fa13

Browse files
committed
Fix bug on duck access without dask (pydata#3391, pydata#5715)
Calls to dask functions are replaced by calls to the pycompat functions
1 parent e26aec9 commit e26fa13

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

xarray/core/parallel.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from .alignment import align
2222
from .dataarray import DataArray
2323
from .dataset import Dataset
24+
from .pycompat import is_duck_dask_array
2425

2526
try:
2627
import dask
@@ -325,13 +326,13 @@ def _wrapper(
325326
raise TypeError("kwargs must be a mapping (for example, a dict)")
326327

327328
for value in kwargs.values():
328-
if dask.is_dask_collection(value):
329+
if is_duck_dask_array(value):
329330
raise TypeError(
330331
"Cannot pass dask collections in kwargs yet. Please compute or "
331332
"load values before passing to map_blocks."
332333
)
333334

334-
if not dask.is_dask_collection(obj):
335+
if not is_duck_dask_array(obj):
335336
return func(obj, *args, **kwargs)
336337

337338
all_args = [obj] + list(args)

0 commit comments

Comments
 (0)