FrankYang0529 commented on PR #72699:
URL: https://github.com/apache/airflow/pull/72699#issuecomment-5697430363

   > Thanks @FrankYang0529 for the follow-up so we will keep them as-is (keep 
the `limit(1)`) instead of changing them all to `one_or_none()` the right? 
Thanks.
   
   Yes, I'd keep the `.limit(1)`. The legacy `Query.one_or_none()` doesn't add 
a LIMIT either. It just calls `self._iter().one_or_none()` 
([query.py#L2792](https://github.com/sqlalchemy/sqlalchemy/blob/rel_2_0_52/lib/sqlalchemy/orm/query.py#L2792)),
 and only `Query.first()` adds `self.limit(1)` 
([query.py#L2762-L2766](https://github.com/sqlalchemy/sqlalchemy/blob/rel_2_0_52/lib/sqlalchemy/orm/query.py#L2762-L2766)).


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