tanelk commented on code in PR #23143:
URL: https://github.com/apache/airflow/pull/23143#discussion_r854909544


##########
airflow/models/pool.py:
##########
@@ -191,11 +191,7 @@ def slots_stats(
 
         # calculate open metric
         for pool_name, stats_dict in pools.items():
-            if stats_dict["total"] == -1:
-                # -1 means infinite
-                stats_dict["open"] = -1
-            else:
-                stats_dict["open"] = stats_dict["total"] - 
stats_dict["running"] - stats_dict["queued"]
+            stats_dict["open"] = stats_dict["total"] - stats_dict["running"] - 
stats_dict["queued"]

Review Comment:
   The if branch is unreachable because few lines above there is:
   ```            
   if total_slots == -1:
       total_slots = float('inf')  # type: ignore
   pools[pool_name] = PoolStats(total=total_slots, running=0, queued=0, open=0)
   ```



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