You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2019/07/10 20:50:17 UTC

[GitHub] [airflow] nuclearpinguin commented on a change in pull request #5517: [AIRFLOW-4292] Cleanup and improve SLA code

nuclearpinguin commented on a change in pull request #5517: [AIRFLOW-4292] Cleanup and improve SLA code
URL: https://github.com/apache/airflow/pull/5517#discussion_r302261483
 
 

 ##########
 File path: airflow/jobs/scheduler_job.py
 ##########
 @@ -389,34 +389,34 @@ def manage_slas(self, dag, session=None):
         Finding all tasks that have SLAs defined, and sending alert emails
         where needed. New SLA misses are also recorded in the database.
 
-        Where assuming that the scheduler runs often, so we only check for
+        We are assuming that the scheduler runs often, so we only check for
         tasks that should have succeeded in the past hour.
         """
-        if not any([isinstance(ti.sla, timedelta) for ti in dag.tasks]):
+        if not any(isinstance(ti.sla, timedelta) for ti in dag.tasks):
             self.log.info("Skipping SLA check for %s because no tasks in DAG have SLAs", dag)
             return
 
+        # Find the last executed tasks
         TI = models.TaskInstance
         sq = (
 
 Review comment:
   Doing such refactor it would be a good idea to change this `sq` name to something more pylint compatible. Maybe then we will be able to remove it from [TODO list](https://github.com/apache/airflow/blob/master/scripts/ci/pylint_todo.txt)?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services