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]]
)
| 186 | |
| 187 | |
| 188 | def 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 |