(eager: bool, default_model_storage: ModelStorage)
| 19 | |
| 20 | @pytest.mark.parametrize("eager", [True, False]) |
| 21 | def test_multi_node_graph_run(eager: bool, default_model_storage: ModelStorage): |
| 22 | graph_schema = GraphSchema( |
| 23 | { |
| 24 | "add": SchemaNode( |
| 25 | needs={"i1": "first_input", "i2": "second_input"}, |
| 26 | uses=AddInputs, |
| 27 | fn="add", |
| 28 | constructor_name="create", |
| 29 | config={}, |
| 30 | eager=eager, |
| 31 | ), |
| 32 | "subtract_2": SchemaNode( |
| 33 | needs={"i": "add"}, |
| 34 | uses=SubtractByX, |
| 35 | fn="subtract_x", |
| 36 | constructor_name="create", |
| 37 | config={"x": 2}, |
| 38 | eager=eager, |
| 39 | is_target=True, |
| 40 | ), |
| 41 | } |
| 42 | ) |
| 43 | |
| 44 | execution_context = ExecutionContext(graph_schema=graph_schema, model_id="1") |
| 45 | |
| 46 | runner = DaskGraphRunner( |
| 47 | graph_schema=graph_schema, |
| 48 | model_storage=default_model_storage, |
| 49 | execution_context=execution_context, |
| 50 | ) |
| 51 | results = runner.run(inputs={"first_input": 3, "second_input": 4}) |
| 52 | assert results["subtract_2"] == 5 |
| 53 | |
| 54 | |
| 55 | @pytest.mark.parametrize("eager", [True, False]) |
nothing calls this directly
no test coverage detected
searching dependent graphs…