MCPcopy
hub / github.com/dask/dask / test_substitute_nested

Function test_substitute_nested

dask/tests/test_task_spec.py:1106–1125  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1104
1105
1106def test_substitute_nested():
1107 def func(alist):
1108 return alist[0] + alist[1]["foo"]
1109
1110 t1 = Task(
1111 "key-1",
1112 func,
1113 List(
1114 TaskRef("a"),
1115 Dict(
1116 {
1117 "foo": TaskRef("b"),
1118 }
1119 ),
1120 ),
1121 )
1122 assert t1.dependencies == {"a", "b"}
1123 t2 = t1.substitute({"a": "c", "b": "d"})
1124 assert t2.dependencies == {"c", "d"}
1125 assert t1({"a": "a", "b": "b"}) == t2({"c": "a", "d": "b"})
1126
1127
1128@pytest.mark.parametrize("Container", [Dict, List, Set, Tuple])

Callers

nothing calls this directly

Calls 5

substituteMethod · 0.95
TaskClass · 0.90
ListClass · 0.90
TaskRefClass · 0.90
DictClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…