You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ur...@apache.org on 2021/09/13 07:26:24 UTC

[airflow] 03/04: Revert TI.xcom_pull() usage

This is an automated email from the ASF dual-hosted git repository.

uranusjr pushed a commit to branch aip-39-docs
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 35232d8028140606d49db2cb595c9583ef35dd87
Author: Tzu-ping Chung <tp...@astronomer.io>
AuthorDate: Mon Sep 13 15:19:16 2021 +0800

    Revert TI.xcom_pull() usage
    
    We need to use execution_date here :/
---
 airflow/models/taskinstance.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/airflow/models/taskinstance.py b/airflow/models/taskinstance.py
index 5120f59..2a74bde 100644
--- a/airflow/models/taskinstance.py
+++ b/airflow/models/taskinstance.py
@@ -2258,8 +2258,10 @@ class TaskInstance(Base, LoggingMixin):
         if dag_id is None:
             dag_id = self.dag_id
 
+        execution_date = self.get_dagrun(session).execution_date
+
         query = XCom.get_many(
-            run_id=self.run_id,
+            execution_date=execution_date,
             key=key,
             dag_ids=dag_id,
             task_ids=task_ids,