Prab-27 commented on code in PR #52325:
URL: https://github.com/apache/airflow/pull/52325#discussion_r2187523284
##########
airflow-core/src/airflow/api_fastapi/execution_api/routes/xcoms.py:
##########
@@ -155,20 +155,20 @@ def get_xcom(
session=session,
)
if params.offset is not None:
- xcom_query =
xcom_query.filter(XComModel.value.is_not(None)).order_by(None)
+ xcom_query =
xcom_query.where(XComModel.value.is_not(None)).order_by(None)
if params.offset >= 0:
xcom_query =
xcom_query.order_by(XComModel.map_index.asc()).offset(params.offset)
else:
xcom_query =
xcom_query.order_by(XComModel.map_index.desc()).offset(-1 - params.offset)
else:
- xcom_query = xcom_query.filter(XComModel.map_index == params.map_index)
+ xcom_query = xcom_query.where(XComModel.map_index == params.map_index)
# We use `BaseXCom.get_many` to fetch XComs directly from the database,
bypassing the XCom Backend.
# This avoids deserialization via the backend (e.g., from a remote storage
like S3) and instead
# retrieves the raw serialized value from the database. By not relying on
`XCom.get_many` or `XCom.get_one`
# (which automatically deserializes using the backend), we avoid potential
# performance hits from retrieving large data files into the API server.
- result = xcom_query.limit(1).first()
+ result = session.scalars(xcom_query.limit(1)).first()
Review Comment:
Just to clarify—do I also need to remove limit(1) here, or does the query
internally use it?
--
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]