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

Function test_persist_nested

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

Source from the content-addressed store, hash-verified

681
682
683def test_persist_nested():
684 a = delayed(1) + 5
685 b = a + 1
686 c = a + 2
687 result = persist({"a": a, "b": [1, 2, b]}, (c, 2))
688 assert isinstance(result[0]["a"], Delayed)
689 assert isinstance(result[0]["b"][2], Delayed)
690 assert isinstance(result[1][0], Delayed)
691 assert compute(*result) == ({"a": 6, "b": [1, 2, 7]}, (8, 2))
692
693 res = persist([a, b], c, traverse=False)
694 assert res[0][0] is a
695 assert res[0][1] is b
696 assert res[1].compute() == 8
697
698
699def 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