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

Function assert_did_not_materialize

dask/tests/test_graph_manipulation.py:65–78  ·  view source on GitHub ↗

Test that all layers of the original collection exist in the cloned collection too and that Blockwise layers have not been materialized

(cloned, orig)

Source from the content-addressed store, hash-verified

63
64
65def assert_did_not_materialize(cloned, orig):
66 """Test that all layers of the original collection exist in the cloned collection
67 too and that Blockwise layers have not been materialized
68 """
69 olayers = orig.__dask_graph__().layers
70 clayers = cloned.__dask_graph__().layers
71 for k, v in olayers.items():
72 try:
73 cv = clayers[k]
74 except KeyError:
75 cv = clayers[clone_key(k, 0)]
76 if isinstance(v, Blockwise):
77 assert not v.is_materialized()
78 assert not cv.is_materialized()
79
80
81# Generic valid keys

Callers

nothing calls this directly

Calls 4

clone_keyFunction · 0.90
__dask_graph__Method · 0.45
itemsMethod · 0.45
is_materializedMethod · 0.45

Tested by

no test coverage detected