brokenjacobs commented on PR #32608:
URL: https://github.com/apache/airflow/pull/32608#issuecomment-1636447903

   I guess I'll PR this once I can test this query after 1.11.0 comes out, but 
I think this keda query will account for pool restrictions, which the current 
query does not do:
   ```
   query: >-
       WITH slotcounts AS (
       SELECT CASE WHEN COUNT(*) > slots THEN slots WHEN COUNT(*) <= slots THEN 
COUNT(*) END AS taskcount FROM task_instance LEFT JOIN slot_pool ON 
task_instance.pool = slot_pool.pool
       WHERE (state='running' OR state='queued') 
       {{- if eq .Values.executor "CeleryKubernetesExecutor" }}
       AND queue != '{{ 
.Values.config.celery_kubernetes_executor.kubernetes_queue }}'
        {{- end }} 
       GROUP BY task_instance.pool, slot_pool.slots
       )
       SELECT COALESCE(CEIL(SUM(taskcount)::decimal / 8),0) FROM slotcounts;
   
   ```


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