Skip to content

all_done trigger rule goes upstream_failed when mapped inputs are all skipped #51320

@collinmcnulty

Description

@collinmcnulty

Apache Airflow version

3.0.1

If "Other Airflow 2 version" selected, which one?

No response

What happened?

A DAG is being marked failed despite all tasks that should be skipped. This only happens when trigger_rule is all_done

What you think should happen instead?

Mapped task should be skipped, not upstream failed.

How to reproduce

This DAG has all tasks skip in Airflow 2, so the DAG state is success. In Airflow 3, it has one task upstream_failed and therefore the DAG as a whole is marked failed.

from airflow.exceptions import AirflowSkipException
from airflow.decorators import dag, task


@dag(
    start_date=None,
    schedule=None,
)
def upstream_skipper():
    @task()
    def skip(**context) -> int:
        raise AirflowSkipException()

    @task(trigger_rule="all_done")
    def consume_skip_all_done(value) -> None:
        """Fails as upstream skipped"""
        print(value)

    @task()
    def consume_skip_all_success(value) -> None:
        """Skipped"""
        print(value)

    consume_skip_all_success.expand(value=skip())
    consume_skip_all_done.expand(value=skip())


upstream_skipper()

Operating System

Debian GNU/Linux 12 (bookworm)

Versions of Apache Airflow Providers

No response

Deployment

Astronomer

Deployment details

No response

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions