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



##########
File path: airflow/executors/base_executor.py
##########
@@ -168,7 +168,7 @@ def order_queued_tasks_by_priority(self) -> 
List[Tuple[TaskInstanceKey, QueuedTa
         :return: List of tuples from the queued_tasks according to the 
priority.
         """
         return sorted(
-            [(k, v) for k, v in self.queued_tasks.items()],  # pylint: 
disable=unnecessary-comprehension
+            ((k, v) for k, v in self.queued_tasks.items()),  # pylint: 
disable=unnecessary-comprehension

Review comment:
       I think this can be further reduced to just `self.queued_tasks.items()`? 
Pylint’s complaint is correct here; the entire comprehension is unnecessary.

##########
File path: airflow/executors/debug_executor.py
##########
@@ -120,7 +120,7 @@ def trigger_tasks(self, open_slots: int) -> None:
         :param open_slots: Number of open slots
         """
         sorted_queue = sorted(
-            [(k, v) for k, v in self.queued_tasks.items()],  # pylint: 
disable=unnecessary-comprehension
+            ((k, v) for k, v in self.queued_tasks.items()),  # pylint: 
disable=unnecessary-comprehension

Review comment:
       Same here.




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


Reply via email to