Fokko commented on a change in pull request #6461: [AIRFLOW-5804] Batch the
xcom pull operation
URL: https://github.com/apache/airflow/pull/6461#discussion_r340611565
##########
File path: airflow/models/taskinstance.py
##########
@@ -1376,17 +1375,20 @@ def xcom_pull(
if dag_id is None:
dag_id = self.dag_id
- pull_fn = functools.partial(
- XCom.get_one,
+ result = XCom.compose_query(
execution_date=self.execution_date,
key=key,
dag_id=dag_id,
- include_prior_dates=include_prior_dates)
+ task_id=task_ids,
+ include_prior_dates=include_prior_dates
+ )
if is_container(task_ids):
- return tuple(pull_fn(task_id=t) for t in task_ids)
+ return [XCom.deserialize_value(xcom) for xcom in result.all()]
Review comment:
Yes, good point. I'll move that out and add some comments.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services