Skip to content

Commit f8127fc

Browse files
authored
Test: new index from dask.array computes only once (#7729)
Closes #1533
1 parent 8626690 commit f8127fc

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

xarray/tests/test_dask.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1701,3 +1701,10 @@ def test_graph_manipulation():
17011701
# names if we were to use HighLevelGraph.cull() instead of
17021702
# HighLevelGraph.cull_layers() in Dataset.__dask_postpersist__().
17031703
assert_equal(ds2.d1 + ds2.d2, ds.d1 + ds.d2)
1704+
1705+
1706+
def test_new_index_var_computes_once():
1707+
# regression test for GH1533
1708+
data = dask.array.from_array(np.array([100, 200]))
1709+
with raise_if_dask_computes(max_computes=1):
1710+
Dataset(coords={"z": ("z", data)})

0 commit comments

Comments
 (0)