Skip to content

Conversation

@avkirilishin
Copy link
Contributor

closes: #17469

Dag Before After
simple_label image image
simple_label_reversed image image
complex_label image image

Tested on dags:
test_label_refactoring.py.zip


^ 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 UPDATING.md.

@avkirilishin avkirilishin force-pushed the label_refactoring_issue_17469 branch 2 times, most recently from 189b221 to 4e810c3 Compare February 8, 2022 07:37
@potiuk potiuk added this to the Airflow 2.2.4 milestone Feb 15, 2022
@potiuk
Copy link
Member

potiuk commented Feb 15, 2022

I think this one needs a deeper look @bbovenzi @kaxil - I think you asked for a fix in #17469 and it LOOKS like a good fix. Which (if confirmed) might even qualify for 2.2.4 release @jedcunningham ? (marked it provisionally).

I do not know that well about EdgeModifiers and relations setting but it does look legit from first look.

And I think possibly some unit tests here woudl be useful. WDYT?

@potiuk
Copy link
Member

potiuk commented Feb 15, 2022

@avkirilishin - would it be possible to add some unit tests for this one ?

@avkirilishin
Copy link
Contributor Author

would it be possible to add some unit tests for this one?

I am ready to add some unit tests if the approach is OK.

@bbovenzi
Copy link
Contributor

Yeah, I would say we should move forward with this approach.

@potiuk
Copy link
Member

potiuk commented Feb 18, 2022

Also good for me so @avkirilishin -> adding some testswill be great.

@avkirilishin
Copy link
Contributor Author

Also good for me so @avkirilishin -> adding some testswill be great.

@potiuk Done

Copy link
Contributor

@bbovenzi bbovenzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@github-actions github-actions bot added the full tests needed We need to run full set of tests for this PR to merge label Feb 20, 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.

@avkirilishin avkirilishin force-pushed the label_refactoring_issue_17469 branch from 4239c97 to a7ef3ba Compare February 23, 2022 17:26
@potiuk potiuk force-pushed the label_refactoring_issue_17469 branch from ccb1bf1 to a023dc9 Compare March 1, 2022 13:22
@potiuk
Copy link
Member

potiuk commented Mar 1, 2022

Rebasing to see if issues are fixed (should be by MS).

@potiuk
Copy link
Member

potiuk commented Mar 1, 2022

Jsut a temporary error that needs to be handled separately.

@ephraimbuddy ephraimbuddy added the type:bug-fix Changelog: Bug Fixes label Apr 8, 2022
ashb added a commit to astronomer/airflow that referenced this pull request Apr 27, 2022
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 added 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()
```
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full tests needed We need to run full set of tests for this PR to merge type:bug-fix Changelog: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Label in front of TaskGroup breaks task dependencies

6 participants