uranusjr commented on code in PR #34665:
URL: https://github.com/apache/airflow/pull/34665#discussion_r1343839914
##########
airflow/dag_processing/manager.py:
##########
@@ -695,15 +696,16 @@ def _fetch_callbacks_with_retries(self, max_callbacks:
int, session: Session):
"""Fetch callbacks from database and add them to the internal queue
for execution."""
self.log.debug("Fetching callbacks from the database.")
with prohibit_commit(session) as guard:
- query = session.query(DbCallbackRequest)
+ query = select(DbCallbackRequest)
if self.standalone_dag_processor:
- query = query.filter(
+ query = query.where(
DbCallbackRequest.processor_subdir ==
self.get_dag_directory(),
)
query =
query.order_by(DbCallbackRequest.priority_weight.asc()).limit(max_callbacks)
callbacks = with_row_locks(
query, of=DbCallbackRequest, session=session,
**skip_locked(session=session)
- ).all()
+ )
+ callbacks = session.scalars(callbacks)
Review Comment:
I have a feeling Mypy might not like this at some point when SQLAlchemy adds
typing support. Rename the variables like this instead:
```python
query = with_row_locks(...)
callbacks = session.scalars(query)
```
--
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]