Skip to content

Commit

Permalink
Test: new index from dask.array computes only once (#7729)
Browse files Browse the repository at this point in the history
Closes #1533
  • Loading branch information
dcherian authored Apr 6, 2023
1 parent 8626690 commit f8127fc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions xarray/tests/test_dask.py
Original file line number Diff line number Diff line change
Expand Up @@ -1701,3 +1701,10 @@ def test_graph_manipulation():
# names if we were to use HighLevelGraph.cull() instead of
# HighLevelGraph.cull_layers() in Dataset.__dask_postpersist__().
assert_equal(ds2.d1 + ds2.d2, ds.d1 + ds.d2)


def test_new_index_var_computes_once():
# regression test for GH1533
data = dask.array.from_array(np.array([100, 200]))
with raise_if_dask_computes(max_computes=1):
Dataset(coords={"z": ("z", data)})

0 comments on commit f8127fc

Please sign in to comment.