uranusjr commented on code in PR #57862:
URL: https://github.com/apache/airflow/pull/57862#discussion_r2517533801
##########
airflow-core/src/airflow/utils/sqlalchemy.py:
##########
@@ -390,7 +392,9 @@ def lock_rows(query: Query, session: Session) ->
Generator[None, None, None]:
:meta private:
"""
- locked_rows = with_row_locks(query, session)
+ select_stmt = cast("Select", query.statement)
Review Comment:
Hmm, why do we need the cast here? (And it’s a bit weird since the `query`
argument is already a `Select`?)
##########
airflow-core/src/airflow/utils/sqlalchemy.py:
##########
@@ -390,7 +392,9 @@ def lock_rows(query: Query, session: Session) ->
Generator[None, None, None]:
:meta private:
"""
- locked_rows = with_row_locks(query, session)
+ select_stmt = cast("Select", query.statement)
+ locked_statement = with_row_locks(select_stmt, session)
+ locked_rows = session.execute(locked_statement).all()
Review Comment:
Do we have to call `all()` here? It’s quite inefficient especially since we
don’t actually use the value.
--
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]