MCPcopy Index your code
hub / github.com/dask/dask / test_like_forgets_graph

Function test_like_forgets_graph

dask/array/tests/test_creation.py:1107–1116  ·  view source on GitHub ↗

Test that array creation functions with like=x do not internally store the graph of x

(func)

Source from the content-addressed store, hash-verified

1105 "func", [da.array, da.asarray, da.asanyarray, da.arange, da.tri]
1106)
1107def test_like_forgets_graph(func):
1108 """Test that array creation functions with like=x do not
1109 internally store the graph of x
1110 """
1111 x = da.arange(3).map_blocks(lambda x: x)
1112 with pytest.raises(Exception, match="local object"):
1113 pickle.dumps(x)
1114
1115 a = func(1, like=x)
1116 pickle.dumps(a)

Callers

nothing calls this directly

Calls 3

funcFunction · 0.70
map_blocksMethod · 0.45
arangeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…