turbaszek commented on a change in pull request #10498:
URL: https://github.com/apache/airflow/pull/10498#discussion_r475237934



##########
File path: airflow/www/views.py
##########
@@ -1437,27 +1500,27 @@ def tree(self):
         node_count = 0
         node_limit = 5000 / max(1, len(dag.leaves))
 
-        def encode_ti(ti: Optional[models.TaskInstance]) -> Optional[List]:
-            if not ti:
+        def encode_ti(task_instance: Optional[models.TaskInstance]) -> 
Optional[List]:
+            if not task_instance:
                 return None
 
             # NOTE: order of entry is important here because client JS relies 
on it for
             # tree node reconstruction. Remember to change JS code in tree.html
             # whenever order is altered.
-            data = [
-                ti.state,
-                ti.try_number,
+            task_instance_data = [
+                task_instance.state,
+                task_instance.try_number,
                 None,  # start_ts
                 None,  # duration
             ]
 
-            if ti.start_date:
+            if task_instance.start_date:
                 # round to seconds to reduce payload size
-                data[2] = int(ti.start_date.timestamp())
-                if ti.duration is not None:
-                    data[3] = int(ti.duration)
+                task_instance_data[2] = 
int(task_instance.start_date.timestamp())
+                if task_instance.duration is not None:
+                    task_instance_data[3] = int(task_instance.duration)
 
-            return data
+            return task_instance_data

Review comment:
       Was this necessary? I think `ti` is quite known in Airflow context and 
we have `ti` as the allowed value in pylinrc. 




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


Reply via email to