Content-Length: 264339 | pFad | http://github.com/apache/airflow/pull/25898/files/bc801f8977a9c79d3ac68007d59357635307d034

4D Rewrite recursion into iteration by uranusjr · Pull Request #25898 · apache/airflow · GitHub
Skip to content

Rewrite recursion into iteration #25898

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions airflow/models/abstractoperator.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,15 +214,18 @@ def get_flat_relative_ids(
if not dag:
return set()

if not found_descendants:
if found_descendants is None:
found_descendants = set()
relative_ids = self.get_direct_relative_ids(upstream)

for relative_id in relative_ids:
if relative_id not in found_descendants:
found_descendants.add(relative_id)
relative_task = dag.task_dict[relative_id]
relative_task.get_flat_relative_ids(upstream, found_descendants)
task_ids_to_trace = self.get_direct_relative_ids(upstream)
while task_ids_to_trace:
task_ids_to_trace_next: Set[str] = set()
for task_id in task_ids_to_trace:
if task_id in found_descendants:
continue
task_ids_to_trace_next.update(dag.task_dict[task_id].get_direct_relative_ids(upstream))
found_descendants.add(task_id)
task_ids_to_trace = task_ids_to_trace_next

return found_descendants

Expand Down








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/apache/airflow/pull/25898/files/bc801f8977a9c79d3ac68007d59357635307d034

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy