ashb commented on a change in pull request #6461: [AIRFLOW-5804] Batch the xcom
pull operation
URL: https://github.com/apache/airflow/pull/6461#discussion_r340608612
##########
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:
Ah I missed the `.with_entities(XCom.value)` in the big hunk of a diff. I
think that should be applied here, not inside `compose_query()`
----------------------------------------------------------------
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