airflow-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Chen <chingchien.c...@gmail.com>
Subject Usage of "on_failure_callback" ?
Date Tue, 18 Oct 2016 18:59:02 GMT
Hi airflow team,

Is there any sample code to use "on_failure_callback" ?
I tried to use that as a callback to "post-process" when a task fails.
However, I cannot make it work.

The definition of my task is as below (just one task in my dag).

It invokes "task0_python_callable" which executes a command-line script and
it could drops exception. It in turns making task0 failed.
In that case, I am thinking it should trigger the "on_failure_callback"
function "task0_failure_cb", but it does not happen.

Any suggestion?
Thanks.

Jason

=========
task0 = PythonOperator(
    task_id='task0',
    python_callable=task0_python_callable,
    on_failure_callback=task0_failure_cb,
    dag=dag)

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message