pierrejeambrun commented on code in PR #72699:
URL: https://github.com/apache/airflow/pull/72699#discussion_r3969222367


##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py:
##########
@@ -436,10 +436,12 @@ def unfavorite_dag(dag_id: str, session: SessionDep, 
user: GetUserDep):
     user_id = str(user.get_id())
 
     favorite_exists = session.execute(
-        select(DagFavorite).where(
+        select(DagFavorite)
+        .where(
             DagFavorite.dag_id == dag_id,
             DagFavorite.user_id == user_id,
         )
+        .limit(1)

Review Comment:
   I think consistency is better instead of removing it here and sending wrong 
signals to other maintainers. Right now this reads as "first()" need to always 
have a `limit(1)` too for results API. Doesn't cost much, but will be easier to 
maintain I believe and not send people off.



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