Skip to content
Open
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
3 changes: 2 additions & 1 deletion airflow-core/src/airflow/serialization/definitions/dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,12 +303,13 @@ def is_task(obj) -> TypeIs[SerializedOperator]:
else:
matched_tasks = [t for t in self.tasks if t.task_id in task_ids]

matched_task_ids = {t.task_id for t in matched_tasks}
also_include_ids: set[str] = set()
for t in matched_tasks:
if include_downstream:
for rel in t.get_flat_relatives(upstream=False, depth=depth):
also_include_ids.add(rel.task_id)
if rel not in matched_tasks: # if it's in there, we're already processing it
if rel.task_id not in matched_task_ids: # if it's in there, we're already processing it
# need to include setups and teardowns for tasks that are in multiple
# non-collinear setup/teardown paths
if not rel.is_setup and not rel.is_teardown:
Expand Down