rawwar commented on code in PR #44366:
URL: https://github.com/apache/airflow/pull/44366#discussion_r1857709141


##########
airflow/api_fastapi/core_api/routes/public/xcom.py:
##########
@@ -90,5 +93,56 @@ def get_xcom_entry(
 
     if stringify:
         return XComResponseString.model_validate(item)
-
     return XComResponseNative.model_validate(item)
+
+
+@xcom_router.get(
+    "",
+    responses=create_openapi_http_exception_doc(
+        [
+            status.HTTP_400_BAD_REQUEST,
+            status.HTTP_404_NOT_FOUND,
+        ]
+    ),
+)
+def get_xcom_entries(
+    dag_id: str,
+    dag_run_id: str,
+    task_id: str,
+    limit: QueryLimit,
+    offset: QueryOffset,
+    session: Annotated[Session, Depends(get_session)],
+    xcom_key: Annotated[str | None, Query()] = None,
+    map_index: Annotated[int | None, Query(ge=-1)] = None,
+) -> XComCollection:
+    """
+    Get all XCom entries.
+
+    This endpoint allows specifying `~` as the dag_id, dag_run_id, task_id to 
retrieve XCom entries for all DAGs.
+    """
+    query = select(XCom)
+    if dag_id != "~":
+        query = query.where(XCom.dag_id == dag_id)
+    query = query.join(DR, and_(XCom.dag_id == DR.dag_id, XCom.run_id == 
DR.run_id))
+
+    if task_id != "~":
+        query = query.where(XCom.task_id == task_id)
+    if dag_run_id != "~":
+        query = query.where(DR.run_id == dag_run_id)
+    if map_index is not None:
+        query = query.where(XCom.map_index == map_index)
+    if xcom_key is not None:
+        query = query.where(XCom.key == xcom_key)
+
+    query, total_entries = paginated_select(
+        select=query,

Review Comment:
   ```suggestion
           statement=query,
   ```
   
   Please pull changes from main. `select` has been renamed to `statement`



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