File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -214,15 +214,18 @@ def get_flat_relative_ids(
214
214
if not dag :
215
215
return set ()
216
216
217
- if not found_descendants :
217
+ if found_descendants is None :
218
218
found_descendants = set ()
219
- relative_ids = self .get_direct_relative_ids (upstream )
220
219
221
- for relative_id in relative_ids :
222
- if relative_id not in found_descendants :
223
- found_descendants .add (relative_id )
224
- relative_task = dag .task_dict [relative_id ]
225
- relative_task .get_flat_relative_ids (upstream , found_descendants )
220
+ task_ids_to_trace = self .get_direct_relative_ids (upstream )
221
+ while task_ids_to_trace :
222
+ task_ids_to_trace_next : Set [str ] = set ()
223
+ for task_id in task_ids_to_trace :
224
+ if task_id in found_descendants :
225
+ continue
226
+ task_ids_to_trace_next .update (dag .task_dict [task_id ].get_direct_relative_ids (upstream ))
227
+ found_descendants .add (task_id )
228
+ task_ids_to_trace = task_ids_to_trace_next
226
229
227
230
return found_descendants
228
231
You can’t perform that action at this time.
0 commit comments