You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/04/14 08:23:47 UTC

[GitHub] [airflow] uranusjr commented on a diff in pull request #23002: Give useful repr to _LazyXComAccess class

uranusjr commented on code in PR #23002:
URL: https://github.com/apache/airflow/pull/23002#discussion_r850204900


##########
airflow/models/taskinstance.py:
##########
@@ -2434,10 +2440,18 @@ def xcom_pull(
             # and include_prior_dates=True), and re-order by map index (reset
             # needed because XCom.get_many() orders by XCom timestamp).
             return _LazyXComAccess(
-                query.with_entities(XCom.value)
-                .filter(XCom.run_id == first.run_id, XCom.task_id == first.task_id, XCom.map_index >= 0)
+                dag_id=first.dag_id,
+                run_id=first.run_id,
+                task_id=first.task_id,
+                query=query.with_entities(XCom.value)
+                .filter(
+                    XCom.run_id == first.run_id,
+                    XCom.task_id == first.task_id,
+                    XCom.dag_id == first.dag_id,
+                    XCom.map_index >= 0,
+                )
                 .order_by(None)
-                .order_by(XCom.map_index.asc())
+                .order_by(XCom.map_index.asc()),
             )

Review Comment:
   Maybe extract this into a classmethod?



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org