dilnazanlid opened a new issue, #73716:
URL: https://github.com/apache/airflow/issues/73716

   ### Description
   
   `GET /dags/{dag_id}/dagSources` loads the `DagVersion` first. The `dag_code`
   relationship is lazy, so reading `dag_version.dag_code` sends a second query.
   Loading `dag_code` together with the version (e.g. via `joinedload`) would
   avoid that extra database round trip.
   
   
   ### Use case/motivation
   
   One query instead of two for each Dag source request. The change affects both
   the model layer (`DagVersion.get_version`) and the API route, so it needs its
   own PR.
   
   ### Related issues
   
   Follow-up from review of #72474.
   
   
   ### Are you willing to submit a PR?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


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