Skip to content
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

fix(ingest)- airflow: update subdag check for compatibility with older Airflow versions #5523

Merged
merged 5 commits into from
Jul 29, 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
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,11 @@ def _get_dependencies(
upstream_task = dag.task_dict[upstream_task_id]

# if upstream task is not a subdag, then skip it
if upstream_task.subdag is None:
upstream_subdag = getattr(upstream_task, "subdag", None)
if upstream_subdag is None:
continue

# else, link the leaf tasks of the upstream subdag as upstream tasks
upstream_subdag = upstream_task.subdag

for upstream_subdag_task_id in upstream_subdag.task_dict:
upstream_subdag_task = upstream_subdag.task_dict[
upstream_subdag_task_id
Expand Down Expand Up @@ -113,7 +112,7 @@ def _get_dependencies(
[
DataJobUrn.create_from_ids(job_id=task_id, data_flow_urn=str(flow_urn))
for task_id in task.upstream_task_ids
if dag.task_dict[task_id].subdag is None
if getattr(dag.task_dict[task_id], "subdag", None) is None
]
+ upstream_subdag_task_urns
+ upstream_subdag_triggers
Expand Down