steveahnahn commented on PR #69281:
URL: https://github.com/apache/airflow/pull/69281#issuecomment-4895662510

   `_latest_version_select()` (used by `get_latest_version()`) already orders 
by `version_number.desc()` and not `created_at`, so both paths use 
`version_number`. `max(version_number)` joined on the `(dag_id, 
version_number)` unique constraint resolves the same single row as 
`order_by(version_number.desc()).limit(1)` therefore unique + non-null means no 
ties, so no divergence. The batch query references `created_at` nowhere.
   
   `test_get_latest_versions_resolves_each_dag_in_one_query` already asserts 
`get_latest_versions()[dag].id == get_latest_version(dag).id` (same version 
resolved by both paths), and 
`test_latest_version_uses_version_number_not_created_at` pins `version_number` 
as the source of truth.


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