hussein-awala commented on code in PR #29094:
URL: https://github.com/apache/airflow/pull/29094#discussion_r1148543840


##########
airflow/jobs/scheduler_job.py:
##########
@@ -221,26 +221,31 @@ def is_alive(self, grace_multiplier: float | None = None) 
-> bool:
 
     def __get_concurrency_maps(
         self, states: list[TaskInstanceState], session: Session
-    ) -> tuple[DefaultDict[str, int], DefaultDict[tuple[str, str], int]]:
+    ) -> tuple[
+        DefaultDict[str, int], DefaultDict[tuple[str, str], int], 
DefaultDict[tuple[str, str, str], int]
+    ]:

Review Comment:
   Since we get the concurrency for each run and task from the created maps, 
and since some of those runs and tasks are not present in the maps (default 
concurrency is 0), I prefer to keep it a default dict instead of using 
`.get(<id>, 0)` everywhere 
([ex](https://github.com/apache/airflow/blob/main/airflow/jobs/scheduler_job.py#L431-L432)).
   
   And for the method typing, I agree but I prefer `Dataclass` over 
`NamedTuple`, WDYT?



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to