amoghrajesh commented on code in PR #70223:
URL: https://github.com/apache/airflow/pull/70223#discussion_r3629906014
##########
task-sdk/src/airflow/sdk/execution_time/lazy_sequence.py:
##########
Review Comment:
Is this dead code as of this diff? It is never constructed by xcom_arg or
any operator code, and it duplicates rather than replacing the actual class
(LazyXComSequence) that has the N-round-trip problem described in the PR.
##########
task-sdk/src/airflow/sdk/execution_time/schema/schema.json:
##########
@@ -2747,6 +2747,49 @@
"title": "GetXCom",
"type": "object"
},
+ "GetXComByKeys": {
Review Comment:
Are these hand edited? Can you run the tooling for this instead? There
should be a prek hook for this.
##########
airflow-core/src/airflow/api_fastapi/execution_api/routes/xcoms.py:
##########
@@ -113,6 +114,7 @@ def has_xcom_access(
dependencies=[Depends(has_xcom_access)],
)
+
Review Comment:
```suggestion
```
##########
airflow-core/src/airflow/api_fastapi/execution_api/routes/xcoms.py:
##########
@@ -356,6 +358,38 @@ def get_xcom(
return XComResponse(key=key, value=(result[0] if isinstance(result, tuple)
else result).value)
[email protected](
+ "/{dag_id}/{run_id}/{task_id}/keys",
+ summary="Get multiple XCom values by keys",
+ description=(
+ "Fetch multiple XCom values by key list in a single database query. "
+ "Optimised for XComIterable iteration, reducing N round-trips to one."
+ ),
+)
+def get_xcom_by_keys(
+ dag_id: str,
+ run_id: str,
+ task_id: str,
+ request_body: XComKeysRequest,
+ session: SessionDep,
+ map_index: Annotated[int, Query()] = -1,
Review Comment:
Why? The PR states that map_index is not needed and this is fetching for a
single map index.
--
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]