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

Function test_persist_nested

dask/tests/test_distributed.py:79–95  ·  view source on GitHub ↗
(c)

Source from the content-addressed store, hash-verified

77
78
79def test_persist_nested(c):
80 a = delayed(1) + 5
81 b = a + 1
82 c = a + 2
83 result = persist({"a": a, "b": [1, 2, b]}, (c, 2), 4, [5])
84 assert isinstance(result[0]["a"], Delayed)
85 assert isinstance(result[0]["b"][2], Delayed)
86 assert isinstance(result[1][0], Delayed)
87
88 sol = ({"a": 6, "b": [1, 2, 7]}, (8, 2), 4, [5])
89 assert compute(*result) == sol
90
91 res = persist([a, b], c, 4, [5], traverse=False)
92 assert res[0][0] is a
93 assert res[0][1] is b
94 assert res[1].compute() == 8
95 assert res[2:] == (4, [5])
96
97
98def test_futures_to_delayed_dataframe(c):

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