Skip to content

Label in front of TaskGroup breaks task dependencies #17469

@cb149

Description

@cb149

Apache Airflow version: 2.1.0

What happened:

Using a Label infront of a TaskGroup breaks task dependencies, as tasks before the TaskGroup will now point to the last task in the TaskGroup.

What you expected to happen:

Task dependencies with or without Labels should be the same (and preferably the Label should be visible outside of the TaskGroup).
Behavior without a Label is as follows:

with TaskGroup("tg1", tooltip="Tasks related to task group") as tg1:
        DummyOperator(task_id="b") >> DummyOperator(task_id="c")

DummyOperator(task_id="a") >> tg1

without Taskgroup

How to reproduce it:

with TaskGroup("tg1", tooltip="Tasks related to task group") as tg1:
        DummyOperator(task_id="b") >> DummyOperator(task_id="c")

    DummyOperator(task_id="a") >> Label("testlabel") >> tg1

with TaskGroup

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions