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

Unify mapped task group lookup logic #34637

Merged
merged 1 commit into from Sep 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 3 additions & 5 deletions airflow/models/abstractoperator.py
Expand Up @@ -365,11 +365,9 @@ def iter_mapped_task_groups(self) -> Iterator[MappedTaskGroup]:

:meta private:
"""
parent = self.task_group
while parent is not None:
if isinstance(parent, MappedTaskGroup):
yield parent
parent = parent.task_group
if (group := self.task_group) is None:
return
yield from group.iter_mapped_task_groups()

def get_closest_mapped_task_group(self) -> MappedTaskGroup | None:
"""Get the mapped task group "closest" to this task in the DAG.
Expand Down