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


##########
airflow/utils/db.py:
##########
@@ -1101,7 +1102,7 @@ def check_conn_type_null(session: Session) -> 
Iterable[str]:
 
     n_nulls = []
     try:
-        n_nulls = 
session.query(Connection.conn_id).filter(Connection.conn_type.is_(None)).all()
+        n_nulls = 
session.execute(select(Connection.conn_id).filter(Connection.conn_type.is_(None))).all()

Review Comment:
   I think I understand what you mean earlier about not selecting. Looks like 
it's not much of a change. Something like the below should work:
   ```python
   
session.scalars(select(func.count(Connection.id)).where(Connection.conn_type.is_(None))).one()
   ```
   or :
   ```python
   
session.scalar(select(func.count(Connection.id)).where(Connection.conn_type.is_(None)))
   ```
   or 
   ```python
   
session.scalars(select(func.count()).select_from(Connection).where(Connection.conn_type.is_(None))).one()
   ```



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