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 2020/06/05 09:22:11 UTC

[GitHub] [airflow] ephraimbuddy commented on a change in pull request #9097: [WIP] Schema and CRUD endpoints Pool

ephraimbuddy commented on a change in pull request #9097:
URL: https://github.com/apache/airflow/pull/9097#discussion_r435798377



##########
File path: airflow/api_connexion/endpoints/pool_endpoint.py
##########
@@ -26,18 +30,33 @@ def delete_pool():
     raise NotImplementedError("Not implemented yet.")
 
 
-def get_pool():
+@provide_session
+def get_pool(pool_name, session):
     """
     Get a pool
     """
-    raise NotImplementedError("Not implemented yet.")
+    pool_id = pool_name
+    query = session.query(Pool)
+    pool = query.filter(Pool.pool == pool_id).one_or_none()
+
+    if pool is None:
+        raise NotFound("Pool not found")
+    return pool_schema.dump(pool)
 
 
-def get_pools():
+@provide_session
+def get_pools(session):
     """
     Get all pools
     """
-    raise NotImplementedError("Not implemented yet.")
+    offset = request.args.get(parameters.page_offset, 0)
+    limit = min(request.args.get(parameters.page_limit, 100), 100)

Review comment:
       ```suggestion
       limit = min(int(request.args.get(parameters.page_limit, 100)), 100)
   ```




----------------------------------------------------------------
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:
users@infra.apache.org