mik-laj commented on a change in pull request #9329:
URL: https://github.com/apache/airflow/pull/9329#discussion_r446850763



##########
File path: airflow/api_connexion/endpoints/pool_endpoint.py
##########
@@ -53,18 +59,59 @@ def get_pools(session):
 
     total_entries = session.query(func.count(Pool.id)).scalar()
     pools = 
session.query(Pool).order_by(Pool.id).offset(offset).limit(limit).all()
-    return pool_collection_schema.dump(PoolCollection(pools=pools, 
total_entries=total_entries)).data
+    return pool_collection_schema.dump(
+        PoolCollection(pools=pools, total_entries=total_entries)
+    ).data
 
 
-def patch_pool():
+@provide_session
+def patch_pool(pool_name, session, update_mask=None):
     """
     Update a pool
     """
-    raise NotImplementedError("Not implemented yet.")
+    # Only slots can be modified in 'default_pool'
+    if pool_name == Pool.DEFAULT_POOL_NAME and request.json["name"] != 
Pool.DEFAULT_POOL_NAME:

Review comment:
       I think that we cannot set any fields as required at this endpoint.
   Both requests below should be considered as valid. I see no reason for the 
clent to pass the name twice (once in the URL, once in the body)
   ```
   PATCH /api/v1/pools/default_pool?update_mask=slots
   {
       "sluts": 80
   }
   ```
   ```
   PATCH /api/v1/pools/awesome_pool?update_mask=name
   {
       "name": "my_new_awesome_pool"
   }
   ```
   




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

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


Reply via email to