uranusjr commented on code in PR #32883:
URL: https://github.com/apache/airflow/pull/32883#discussion_r1289595412
##########
airflow/dag_processing/processor.py:
##########
@@ -428,20 +428,20 @@ def manage_slas(cls, dag_folder, dag_id: str, session:
Session = NEW_SESSION) ->
if not any(isinstance(ti.sla, timedelta) for ti in dag.tasks):
cls.logger().info("Skipping SLA check for %s because no tasks in
DAG have SLAs", dag)
return
-
qry = (
- session.query(TI.task_id,
func.max(DR.execution_date).label("max_ti"))
+ select(TI.task_id, func.max(DR.execution_date).label("max_ti"))
.join(TI.dag_run)
- .filter(TI.dag_id == dag.dag_id)
- .filter(or_(TI.state == TaskInstanceState.SUCCESS, TI.state ==
TaskInstanceState.SKIPPED))
- .filter(TI.task_id.in_(dag.task_ids))
+ .where(TI.dag_id == dag.dag_id)
+ .where(or_(TI.state == TaskInstanceState.SUCCESS, TI.state ==
TaskInstanceState.SKIPPED))
+ .where(TI.task_id.in_(dag.task_ids))
.group_by(TI.task_id)
- .subquery("sq")
Review Comment:
IIRC not using `subquery` here is deprecated so the call should be kept.
--
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]