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

Function test_persist_nested

dask/tests/test_base.py:694–707  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

692
693
694def test_persist_nested():
695 a = delayed(1) + 5
696 b = a + 1
697 c = a + 2
698 result = persist({"a": a, "b": [1, 2, b]}, (c, 2))
699 assert isinstance(result[0]["a"], Delayed)
700 assert isinstance(result[0]["b"][2], Delayed)
701 assert isinstance(result[1][0], Delayed)
702 assert compute(*result) == ({"a": 6, "b": [1, 2, 7]}, (8, 2))
703
704 res = persist([a, b], c, traverse=False)
705 assert res[0][0] is a
706 assert res[0][1] is b
707 assert res[1].compute() == 8
708
709
710def test_persist_delayed():

Callers

nothing calls this directly

Calls 4

delayedFunction · 0.90
persistFunction · 0.90
computeFunction · 0.90
computeMethod · 0.45

Tested by

no test coverage detected