You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/02/23 20:28:00 UTC

[GitHub] [airflow] jkramer-ginkgo commented on a change in pull request #21770: Fix assignment of unassigned triggers

jkramer-ginkgo commented on a change in pull request #21770:
URL: https://github.com/apache/airflow/pull/21770#discussion_r813288999



##########
File path: airflow/models/trigger.py
##########
@@ -184,7 +184,10 @@ def assign_unassigned(cls, triggerer_id, capacity, session=None):
         # Find triggers who do NOT have an alive triggerer_id, and then assign
         # up to `capacity` of those to us.
         trigger_ids_query = (
-            session.query(cls.id).filter(cls.triggerer_id.notin_(alive_triggerer_ids)).limit(capacity).all()
+            session.query(cls.id)
+            .filter(or_(cls.triggerer_id.notin_(alive_triggerer_ids), cls.triggerer_id == None))  # noqa: E711

Review comment:
       no, unfortunately that's a quirk with sqlalchemy's `notin_` (test fails when that's removed). I'll add a comment to that effect




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org