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


##########
airflow-core/src/airflow/serialization/definitions/xcom_arg.py:
##########
@@ -145,22 +157,103 @@ def iter_references(self) -> Iterator[tuple[Operator, 
str]]:
             yield from arg.iter_references()
 
 
+def _match_referenced_tasks(model: Any, keys: Iterable[tuple[str, str]]) -> 
tuple[Any, Any]:
+    """
+    Build filters selecting rows of ``model`` for any of the given ``(dag_id, 
task_id)``.
+
+    Matching the two columns independently rather than as a row value keeps 
the query
+    portable. That is wider than the key set only if the keys span several 
Dags, which
+    the callers never do, and callers read results back by exact key 
regardless.
+    """
+    dag_ids, task_ids = zip(*keys)
+    return model.dag_id.in_(set(dag_ids)), model.task_id.in_(set(task_ids))

Review Comment:
   ```suggestion
       return model.dag_id.in_(dag_ids), model.task_id.in_(task_ids)
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to