ashb commented on a change in pull request #7527: [AIRFLOW-6907] Simplify SchedulerJob URL: https://github.com/apache/airflow/pull/7527#discussion_r383874965
########## File path: airflow/jobs/scheduler_job.py ########## @@ -1098,37 +1094,20 @@ def _find_executable_task_instances(self, simple_dag_bag, states, session=None): TI = models.TaskInstance DR = models.DagRun DM = models.DagModel - ti_query = ( + task_instances_to_examine = ( session .query(TI) .filter(TI.dag_id.in_(simple_dag_bag.dag_ids)) .outerjoin( - DR, - and_(DR.dag_id == TI.dag_id, DR.execution_date == TI.execution_date) + DR, and_(DR.dag_id == TI.dag_id, DR.execution_date == TI.execution_date) ) - .filter(or_(DR.run_id == None, # noqa: E711 pylint: disable=singleton-comparison - not_(DR.run_id.like(BackfillJob.ID_PREFIX + '%')))) + .filter(or_(DR.run_id.is_(None), not_(DR.run_id.like(BackfillJob.ID_PREFIX + '%')))) .outerjoin(DM, DM.dag_id == TI.dag_id) - .filter(or_(DM.dag_id == None, # noqa: E711 pylint: disable=singleton-comparison - not_(DM.is_paused))) + .filter(or_(DM.dag_id.is_(None), not_(DM.is_paused))) Review comment: (Sorry for not being clear. This comment was not about this PR, but about the other one) ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services