SamWheating commented on a change in pull request #21829:
URL: https://github.com/apache/airflow/pull/21829#discussion_r815347502



##########
File path: airflow/models/dag.py
##########
@@ -2625,6 +2625,18 @@ def validate_schedule_and_params(self):
                     "DAG Schedule must be None, if there are any required 
params without default values"
                 )
 
+    @provide_session
+    def validate_task_pools(self, session=NEW_SESSION):
+        """Validates and raise exception if any task in a dag is using a 
non-existent pool"""
+        from airflow.models.pool import Pool
+
+        pools = [p.pool for p in Pool.get_pools(session)]

Review comment:
       Do you think it would be more performant to use a set instead of a list 
here since we're doing potentially a lot of `task not in pools`? 
   
   The list is pretty small so I'm not sure how significant the difference 
would be.




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