You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Aizhamal Nurmamat kyzy (JIRA)" <ji...@apache.org> on 2019/05/17 22:19:04 UTC

[jira] [Updated] (AIRFLOW-3280) SubDagOperator marked as failed, even if inner sub dag succeeds

     [ https://issues.apache.org/jira/browse/AIRFLOW-3280?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aizhamal Nurmamat kyzy updated AIRFLOW-3280:
--------------------------------------------
         Labels: subdag  (was: )
    Component/s: operators

Adding 'operators' component and 'subdag' label for component refactor.

> SubDagOperator marked as failed, even if inner sub dag succeeds
> ---------------------------------------------------------------
>
>                 Key: AIRFLOW-3280
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-3280
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: operators, subdag
>    Affects Versions: 1.9.0
>            Reporter: Eran
>            Priority: Major
>              Labels: subdag
>
> Running the following dag:
> {code:java}
> from airflow.exceptions import AirflowException
> from airflow.models import DAG
> from airflow.operators.dummy_operator import DummyOperator
> from airflow.operators.python_operator import PythonOperator
> from airflow.operators.subdag_operator import SubDagOperator
> dag = DAG(dag_id="test_dag", start_date='2018-10-01', schedule_interval=None)
> inner_dag = DAG(dag_id="test_dag.sub_dag_task", start_date='2018-10-01', schedule_interval=None)
> sub_dag_operator = SubDagOperator(task_id="sub_dag_task", subdag=inner_dag, dag=dag)
> def throw_exception():
>     raise AirflowException()
> dummy_operator1 = DummyOperator(task_id="dummy1", dag=inner_dag)
> python_operator = PythonOperator(task_id="python1", dag=inner_dag, python_callable=throw_exception)
> dummy_operator2 = DummyOperator(task_id="dummy2", dag=inner_dag, trigger_rule="all_failed")
> dummy_operator3 = DummyOperator(task_id="dummy3", dag=inner_dag)
> dummy_operator4 = DummyOperator(task_id="dummy4", dag=inner_dag)
> dummy_operator5 = DummyOperator(task_id="dummy5", dag=inner_dag, trigger_rule="all_failed")
> dummy_operator1 >> python_operator >> dummy_operator2
> python_operator >> dummy_operator3
> dummy_operator3 >> dummy_operator2
> dummy_operator2 >> dummy_operator4
> dummy_operator2 >> dummy_operator5
> {code}
> would result in a sub_dag_task as 'failed', even though the inner dag (when clicking 'zoom into Sub DAG') is marked as 'success', only because there are a few tasks marked as failed (which is ok, if its not the end of the DAG)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)