Skip to content

trigger_rule=TriggerRule.ONE_FAILED doesn't work properly with task_groups #30333

@antonio-antuan

Description

@antonio-antuan

Apache Airflow version

2.5.2 (checked on 2.5.3 also)

What happened

I'd like to setup "watcher" pattern inside of task_group, but the task always marked as "skipped".
reference to a similar issue: #30334 30334

What you think should happen instead

No response

How to reproduce

from datetime import datetime

from airflow import DAG
from airflow.decorators import task_group
from airflow.operators.python import task
from airflow.utils.trigger_rule import TriggerRule


@task(retries=0, trigger_rule=TriggerRule.ONE_FAILED)
def watcher():
    pass


@task
def foo(x):
    pass

@task
def failed(x):
    raise Exception("Failed")


@task_group()
def process_attestation(x):
    [foo(x), failed(x)] >> watcher()


with DAG(
        dag_id='test',
        start_date=datetime.now(),
) as dag:
    # Receives sboms from database, one row per each DAG run.
    # Will be changed in the future with HTTP-endpoint or something like that.
    @task
    def provider():
        return [1, 2, 3]


    process_attestation.expand(x=provider())

Operating System

Arch Linux (kernel 6.2.6)

Versions of Apache Airflow Providers

apache-airflow-providers-amazon==7.3.0
apache-airflow-providers-common-sql==1.3.4
apache-airflow-providers-ftp==3.3.1
apache-airflow-providers-google==8.11.0
apache-airflow-providers-http==4.2.0
apache-airflow-providers-imap==3.1.1
apache-airflow-providers-postgres==5.4.0
apache-airflow-providers-sqlite==3.3.1

Deployment

Docker-Compose

Deployment details

No response

Anything else

the result graph screenshot:
image

task instance details screenshot:
image

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions