uranusjr commented on a change in pull request #19553:
URL: https://github.com/apache/airflow/pull/19553#discussion_r748241982



##########
File path: airflow/dag_processing/processor.py
##########
@@ -389,6 +389,12 @@ def manage_slas(self, dag: DAG, session: Session = None) 
-> None:
             .group_by(TI.task_id)
             .subquery('sq')
         )
+        # get recorded SlaMiss
+        recorded_slas = (
+            session.query(SlaMiss.dag_id, SlaMiss.task_id, 
SlaMiss.execution_date)
+            .filter(SlaMiss.dag_id == dag.dag_id, 
SlaMiss.task_id.in_(dag.task_ids))
+            .all()
+        )

Review comment:
       ```suggestion
           recorded_slas_query = set(
               session.query(SlaMiss.dag_id, SlaMiss.task_id, 
SlaMiss.execution_date)
               .filter(SlaMiss.dag_id == dag.dag_id, 
SlaMiss.task_id.in_(dag.task_ids))
           )
   ```
   
   Make lookup faster.




-- 
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]


Reply via email to