Skip to content

one_success trigger_rule scheduling exception #42581

@luoyuliuyin

Description

@luoyuliuyin

Apache Airflow version

main (development)

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

No response

What happened?

image
The trigger_rule of task_one_success is one_success. When the upstream node of task_one_success has not yet run, task_one_success is skipped. According to the semantics of one_success, task_one_success should be able to run.

The final result is as follows
image

My code is

from airflow import DAG
from airflow.operators.bash import BashOperator
from airflow.operators.python import BranchPythonOperator

with DAG(dag_id='error_test', schedule=None, default_args={}, ) as dag:
    branch = BranchPythonOperator(task_id='branch', python_callable=lambda: 'task_run')
    task_run = BashOperator(task_id='task_run', bash_command='echo 0')
    task_skip = BashOperator(task_id='task_skip', bash_command='echo 0')
    task_1 = BashOperator(task_id='task_1', bash_command='echo 0')
    task_one_success = BashOperator(task_id='task_one_success', bash_command='echo 0', trigger_rule='one_success')
    task_2 = BashOperator(task_id='task_2', bash_command='echo 0')

    task_1 >> task_2
    branch >> task_skip
    branch >> task_run
    task_run >> task_one_success
    task_skip >> task_one_success
    task_one_success >> task_2
    task_skip >> task_2

What you think should happen instead?

No response

How to reproduce

The task_one_success node should be run

Operating System

centos and macos

Versions of Apache Airflow Providers

No response

Deployment

Official Apache Airflow Helm Chart

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

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions