MCPcopy
hub / github.com/zenml-io/zenml / find_all_downstream_steps

Function find_all_downstream_steps

src/zenml/utils/run_utils.py:188–206  ·  view source on GitHub ↗

Find all downstream steps of a given step. Args: step_name: The name of the step to find the downstream steps of. dag: The DAG. Returns: The set of downstream steps.

(
    step_name: str, dag: Dict[str, Set[str]]
)

Source from the content-addressed store, hash-verified

186
187
188def find_all_downstream_steps(
189 step_name: str, dag: Dict[str, Set[str]]
190) -> Set[str]:
191 """Find all downstream steps of a given step.
192
193 Args:
194 step_name: The name of the step to find the downstream steps of.
195 dag: The DAG.
196
197 Returns:
198 The set of downstream steps.
199 """
200 downstream_steps = set()
201 for downstream_step in dag[step_name]:
202 downstream_steps.add(downstream_step)
203 downstream_steps.update(
204 find_all_downstream_steps(downstream_step, dag)
205 )
206 return downstream_steps

Calls 2

addMethod · 0.80
updateMethod · 0.45