Prab-27 commented on code in PR #52325:
URL: https://github.com/apache/airflow/pull/52325#discussion_r2308962451


##########
airflow-core/src/airflow/api_fastapi/core_api/services/public/dag_run.py:
##########
@@ -49,13 +49,14 @@ async def _get_dag_run(self) -> DagRun:
             return await 
session.scalar(select(DagRun).filter_by(dag_id=self.dag_id, run_id=self.run_id))
 
     def _serialize_xcoms(self) -> dict[str, Any]:
-        xcom_query = XComModel.get_many(
-            run_id=self.run_id,
-            key=XCOM_RETURN_KEY,
-            task_ids=self.result_task_ids,
-            dag_ids=self.dag_id,
-        )
-        xcom_query = xcom_query.order_by(XComModel.task_id, 
XComModel.map_index)
+        with create_session() as session:

Review Comment:
   @uranusjr , 
   
   Sorry, I didn’t quite understand. Could you please help me resolve this 
question when you have some free time : 
   How can I use session = SessionDep() effectively?
   
   1 - Should I pass it as an argument and update all usages of this function?
   2 -Do I need to explicitly close SessionDep here?
   3 -Or is there another approach you’d recommend?



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