From 581f4652a295c66a11fe287dae5b0e2589ecde11 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sun, 22 Sep 2024 20:00:37 +0200 Subject: [PATCH] don't try to create a `dask` array if `dask` is not installed --- xarray/tests/test_indexing.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xarray/tests/test_indexing.py b/xarray/tests/test_indexing.py index 78a63cb380c..92c21cc32fb 100644 --- a/xarray/tests/test_indexing.py +++ b/xarray/tests/test_indexing.py @@ -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)