jason810496 commented on code in PR #56813:
URL: https://github.com/apache/airflow/pull/56813#discussion_r2451808251


##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/hitl.py:
##########
@@ -286,7 +286,10 @@ def get_hitl_details(
         session=session,
     )
 
-    hitl_details = session.scalars(hitl_detail_select)
+    hitl_details_raw = list(session.scalars(hitl_detail_select))
+
+    # Convert SQLAlchemy models to Pydantic models
+    hitl_details = [HITLDetail.model_validate(hitl_detail) for hitl_detail in 
hitl_details_raw]

Review Comment:
   Is it required to convert to Pydantic models to solve the MyPy error here?



##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_versions.py:
##########
@@ -122,7 +122,7 @@ def get_dag_versions(
         limit=limit,
         session=session,
     )
-    dag_versions = session.scalars(dag_versions_select)
+    dag_versions = list(session.scalars(dag_versions_select))

Review Comment:
   There are still quite a few place that use `list(...)`for copying result.
   It would be nice to check all similar usage in the PR and try whether could 
we avoid coping.
   Thanks!



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