MCPcopy Create free account
hub / github.com/dask/dask / test_like_forgets_graph

Function test_like_forgets_graph

dask/array/tests/test_creation.py:1106–1115  ·  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

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