phi-friday commented on code in PR #38942:
URL: https://github.com/apache/airflow/pull/38942#discussion_r1562161547
##########
airflow/api_connexion/endpoints/xcom_endpoint.py:
##########
@@ -74,8 +74,8 @@ def get_xcom_entries(
# Match idx_xcom_task_instance + idx_xcom_key for performance.
query = query.order_by(XCom.dag_id, XCom.task_id, XCom.run_id,
XCom.map_index, XCom.key)
total_entries = get_query_count(query, session=session)
- query = session.scalars(query.offset(offset).limit(limit))
- return xcom_collection_schema.dump(XComCollection(xcom_entries=query,
total_entries=total_entries))
+ xcom_entries = session.scalars(query.offset(offset).limit(limit)).all()
+ return
xcom_collection_schema.dump(XComCollection(xcom_entries=xcom_entries,
total_entries=total_entries))
Review Comment:
I used `.all()` because `XComCollection` has `list[XCom]`, which is handled
directly by `.dump()`.
Should I use `cast` instead?
--
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]