mik-laj commented on a change in pull request #6792: [AIRFLOW-5930] Use 
cached-SQL query building for hot-path queries
URL: https://github.com/apache/airflow/pull/6792#discussion_r356995764
 
 

 ##########
 File path: airflow/models/dagrun.py
 ##########
 @@ -263,10 +294,14 @@ def update_state(self, session=None):
         Determines the overall state of the DagRun based on the state
         of its TaskInstances.
 
-        :return: State
+        :return: state, schedulable_task_instances
+        :rtype: (State, list[TaskInstance])
         """
+        from airflow.ti_deps.deps.ready_to_reschedule import 
ReadyToRescheduleDep
+        from airflow.ti_deps.deps.not_in_retry_period_dep import 
NotInRetryPeriodDep
 
         dag = self.get_dag()
+        tis_to_schedule = []
 
         tis = self.get_task_instances(session=session)
         self.log.debug("Updating state for %s considering %s task(s)", self, 
len(tis))
 
 Review comment:
   Do you think it is worth dividing the loop from line 272 into two loops? One 
loop will filters the elements and the second loop will set tasks on task 
instances. This does not affect performance, but will make it easier to 
understand the code.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to