Skip to content

Commit

Permalink
also check dask
Browse files Browse the repository at this point in the history
  • Loading branch information
keewis committed Sep 22, 2024
1 parent ecb47d6 commit 445a887
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions xarray/tests/test_indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
(
Expand All @@ -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"
),
Expand Down

0 comments on commit 445a887

Please sign in to comment.