Skip to content

Commit

Permalink
don't try to create a dask array if dask is not installed
Browse files Browse the repository at this point in the history
  • Loading branch information
keewis committed Sep 22, 2024
1 parent 445a887 commit 581f465
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion xarray/tests/test_indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,10 @@ def __array_function__(self, func, types, args, kwargs):


def as_dask_array(arr, chunks):
import dask.array as da
try:
import dask.array as da
except ImportError:
return None

return da.from_array(arr, chunks=chunks)

Expand Down

0 comments on commit 581f465

Please sign in to comment.