ashb commented on code in PR #32177:
URL: https://github.com/apache/airflow/pull/32177#discussion_r1245180155


##########
airflow/utils/db.py:
##########
@@ -92,7 +92,7 @@ def _format_airflow_moved_table_name(source_table, version, 
category):
 @provide_session
 def merge_conn(conn, session: Session = NEW_SESSION):
     """Add new Connection."""
-    if not 
session.query(conn.__class__).filter_by(conn_id=conn.conn_id).first():
+    if not 
session.scalar(select(conn.__class__).filter_by(conn_id=conn.conn_id).limit(1)):

Review Comment:
   Isn't this `.exists()`? 
https://docs.sqlalchemy.org/en/20/orm/queryguide/query.html#sqlalchemy.orm.Query.exists



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