I have 3 DAG runs:
- DAGR 1 executed at 2019-02-13 16:00:00
- DAGR 2 executed at 2019-02-13 17:00:00
- DAGR 3 executed at 2019-02-13 18:00:00
In a task instance X of DAGR 1 I want to get xcom value of task instance Y. I did this:
kwargs['task_instance'].xcom_pull(task_ids='Y')
I expected to get value of xcom from task instance Y in DAGR 1. Instead I got from DAGR 3.
From Airflow documentation
If
xcom_pullis passed a single string fortask_ids, then the most recent XCom value from that task is returned; ...
- Why Airflow
xcom_pullreturn the most recent xcom value? - What if I want to pull from the same DAG run?