vendredi 15 novembre 2019

airflow test mode xcom pull/push not working

I try to test 2 tasks through the airflow cli test command`

The first task run, auto pushes last console out to xcom and i see the value some value in the airflow GUI as expected

When i run the second task via airflow cli test command i just get None as return value but as i have read here: How to test Apache Airflow tasks that uses XCom that it should work and at least the xcom_push is obvious working, why not the xcom_pull?

Someone has a hint how to get this working? Provide context is set to true.

Example code:

t1 = BashOperator(
    task_id='t1',
    bash_command='echo "some value"',
    xcom_push=True,
    dag=dag
)

t2 = BashOperator(
    task_id='t2',
    bash_command='echo ',
    xcom_push=True,
    dag=dag
)

Thanks!

Edit: when i run the code (DAG) without test mode the xcom_pull works fine

Aucun commentaire:

Enregistrer un commentaire