From 445a887ee08586bb06cc774c023ac5dd6b1230c0 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sun, 22 Sep 2024 15:06:43 +0200 Subject: [PATCH] also check dask --- xarray/tests/test_indexing.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/xarray/tests/test_indexing.py b/xarray/tests/test_indexing.py index 4bf05471d71..78a63cb380c 100644 --- a/xarray/tests/test_indexing.py +++ b/xarray/tests/test_indexing.py @@ -912,6 +912,12 @@ def __array_function__(self, func, types, args, kwargs): pass +def as_dask_array(arr, chunks): + import dask.array as da + + return da.from_array(arr, chunks=chunks) + + @pytest.mark.parametrize( ["array", "expected_type"], ( @@ -926,6 +932,12 @@ def __array_function__(self, func, types, args, kwargs): pytest.param( pd.Index([1, 2]), indexing.PandasIndexingAdapter, id="pandas.Index" ), + pytest.param( + as_dask_array(np.array([1, 2]), chunks=(1,)), + indexing.DaskIndexingAdapter, + id="dask.array", + marks=requires_dask, + ), pytest.param( ArrayWithNamespace(), indexing.ArrayApiIndexingAdapter, id="array_api" ),