Description
The FlowGraph class in services/ui_backend_service/data/cache/custom_flowgraph.py computes is_inside_foreach for every DAG step during graph postprocessing. This flag correctly identifies which steps run inside a foreach branch. However, the node_to_dict() function that serializes nodes into the API response never includes this field, it is currently silently dropped before reaching API consumers.
Exposing this metadata is a critical enabler for metaflow-ui#180 which unblocks Metaflow UI issue #88., which introduces a high-density "Expanded DAG" mode. With this field, it would be an additional plus the UI can now distinguish between a regular linear step and a step that executes as part of a foreach branch.
Steps to Reproduce
- Run
metaflow-service locally.
- Execute a Flow that contains a
foreach step (e.g., self.next(self.process, foreach='items')).
- Query the DAG API:
GET /flows/{flow_id}/runs/{run_number}/dag.
- Inspect the JSON response for the child step (e.g., process).
Expected behavior:
The step node info should include "is_inside_foreach": true.
Actual behavior:
The is_inside_foreach field is missing. The step reports "type": "linear" only.
Reproduces how often:
100% of the time.
Versions
- Metaflow Service: master
- OS: macOS / Linux
Additional Information
This is a one-line fix in node_to_dict() that unblocks Metaflow UI issue #88.
Description
The FlowGraph class in services/ui_backend_service/data/cache/custom_flowgraph.py computes
is_inside_foreachfor every DAG step during graph postprocessing. This flag correctly identifies which steps run inside aforeachbranch. However, the node_to_dict() function that serializes nodes into the API response never includes this field, it is currently silently dropped before reaching API consumers.Exposing this metadata is a critical enabler for metaflow-ui#180 which unblocks Metaflow UI issue #88., which introduces a high-density "Expanded DAG" mode. With this field, it would be an additional plus the UI can now distinguish between a regular linear step and a step that executes as part of a foreach branch.
Steps to Reproduce
metaflow-servicelocally.foreachstep (e.g.,self.next(self.process, foreach='items')).GET /flows/{flow_id}/runs/{run_number}/dag.Expected behavior:
The step node info should include
"is_inside_foreach": true.Actual behavior:
The
is_inside_foreachfield is missing. The step reports"type": "linear"only.Reproduces how often:
100% of the time.
Versions
Additional Information
This is a one-line fix in node_to_dict() that unblocks Metaflow UI issue #88.