Skip to content

Conversation

@ashb
Copy link
Member

@ashb ashb commented Apr 27, 2022

This reverts commit ace8c6e.

Fixes #23285

This dag breaks with a cycle as group.end has itself as a downstream otherwise:

from pendulum import datetime

from airflow.decorators import dag, task, task_group
from airflow.utils.edgemodifier import Label

@task
def begin():
    ...

@task
def end():
    ...

@dag(start_date=datetime(2022, 1, 1), schedule_interval=None)
def task_groups_with_edge_labels():
    @task_group
    def group():
        begin() >> end()

    group()

_ = task_groups_with_edge_labels()

^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragement file, named {pr_number}.significant.rst, in newsfragments.

This reverts commit ace8c6e.

Fixes apache#23285

This dag breaks with a cycle as group.end has itself as a downstream otherwise:

```python
from pendulum import datetime

from airflow.decorators import dag, task, task_group
from airflow.utils.edgemodifier import Label

@task
def begin():
    ...

@task
def end():
    ...

@dag(start_date=datetime(2022, 1, 1), schedule_interval=None)
def task_groups_with_edge_labels():
    @task_group
    def group():
        begin() >> end()

    group()

_ = task_groups_with_edge_labels()
```
@ashb ashb requested review from XD-DENG and kaxil as code owners April 27, 2022 17:31
@ashb ashb requested a review from josh-fell April 27, 2022 17:32
@ashb ashb added this to the Airflow 2.3.0 milestone Apr 27, 2022
@github-actions github-actions bot added the full tests needed We need to run full set of tests for this PR to merge label Apr 27, 2022
@github-actions
Copy link

The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.

@ashb ashb merged commit 3182303 into apache:main Apr 27, 2022
@ashb ashb deleted the dag-labels-cycle-false-positive branch April 27, 2022 18:12
ephraimbuddy pushed a commit that referenced this pull request Apr 27, 2022
This reverts commit ace8c6e.

Fixes #23285

This dag breaks with a cycle as group.end has itself as a downstream otherwise:

```python
from pendulum import datetime

from airflow.decorators import dag, task, task_group
from airflow.utils.edgemodifier import Label

@task
def begin():
    ...

@task
def end():
    ...

@dag(start_date=datetime(2022, 1, 1), schedule_interval=None)
def task_groups_with_edge_labels():
    @task_group
    def group():
        begin() >> end()

    group()

_ = task_groups_with_edge_labels()
```

(cherry picked from commit 3182303)
ephraimbuddy pushed a commit that referenced this pull request Apr 27, 2022
This reverts commit ace8c6e.

Fixes #23285

This dag breaks with a cycle as group.end has itself as a downstream otherwise:

```python
from pendulum import datetime

from airflow.decorators import dag, task, task_group
from airflow.utils.edgemodifier import Label

@task
def begin():
    ...

@task
def end():
    ...

@dag(start_date=datetime(2022, 1, 1), schedule_interval=None)
def task_groups_with_edge_labels():
    @task_group
    def group():
        begin() >> end()

    group()

_ = task_groups_with_edge_labels()
```

(cherry picked from commit 3182303)
@ephraimbuddy ephraimbuddy added the changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) label May 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) full tests needed We need to run full set of tests for this PR to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cycle incorrectly detected in DAGs when using Labels within Task Groups

4 participants