phanikumv commented on code in PR #32177:
URL: https://github.com/apache/airflow/pull/32177#discussion_r1243526571
##########
airflow/utils/db.py:
##########
@@ -959,7 +959,9 @@ def check_conn_id_duplicates(session: Session) ->
Iterable[str]:
dups = []
try:
- dups =
session.query(Connection.conn_id).group_by(Connection.conn_id).having(func.count()
> 1).all()
+ dups = session.execute(
+
select(Connection.conn_id).group_by(Connection.conn_id).having(func.count() > 1)
+ ).all()
Review Comment:
changed `all()` to `first()`
##########
airflow/utils/db.py:
##########
@@ -984,12 +986,11 @@ def check_username_duplicates(session: Session) ->
Iterable[str]:
for model in [User, RegisterUser]:
dups = []
try:
- dups = (
- session.query(model.username) # type: ignore[attr-defined]
+ dups = session.execute(
+ select(model.username) # type: ignore[attr-defined]
.group_by(model.username) # type: ignore[attr-defined]
.having(func.count() > 1)
- .all()
- )
+ ).all()
Review Comment:
changed all() to first()
--
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]