uranusjr commented on code in PR #57532:
URL: https://github.com/apache/airflow/pull/57532#discussion_r2497232784
##########
airflow-core/src/airflow/models/dag.py:
##########
@@ -516,13 +518,13 @@ def get_paused_dag_ids(dag_ids: list[str], session:
Session = NEW_SESSION) -> se
:param session: ORM Session
:return: Paused Dag_ids
"""
- paused_dag_ids = session.execute(
+ result = session.execute(
select(DagModel.dag_id)
.where(DagModel.is_paused == expression.true())
.where(DagModel.dag_id.in_(dag_ids))
)
- paused_dag_ids = {paused_dag_id for (paused_dag_id,) in paused_dag_ids}
+ paused_dag_ids = {paused_dag_id for (paused_dag_id,) in result}
Review Comment:
I think this can just be
```python
paused_dag_ids = set(
session.scalars(
select(DagModel.dag_id)
.where(DagModel.is_paused == expression.true())
.where(DagModel.dag_id.in_(dag_ids))
)
)
```
--
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]