ephraimbuddy commented on PR #56422:
URL: https://github.com/apache/airflow/pull/56422#issuecomment-3442706161

   Maybe:
   
   ```sql
   dag_version = session.scalar(
               select(DagVersion)
               .where(
                   DagVersion.dag_id == dag.dag_id,
                   DagVersion.bundle_name == bundle_name
               )
               .options(joinedload(DagVersion.task_instances))
               .options(joinedload(DagVersion.serialized_dag))
               .order_by(DagVersion.created_at.desc())
               .limit(1)
           )
   ```
   In the above, I used `scalar` instead of `scalars` and removed `first()`, 
there's no need since limit is `1`.  I removed bundle_version in query. I think 
this will work


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