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



##########
File path: airflow/api_connexion/endpoints/connection_endpoint.py
##########
@@ -47,31 +55,53 @@ def get_connection(connection_id, session):
 
 
 @provide_session
-def get_connections(session):
+def get_connections(session, limit, offset=0):
     """
     Get all connection entries
     """
-    offset = request.args.get(parameters.page_offset, 0)
-    limit = min(int(request.args.get(parameters.page_limit, 100)), 100)
-
+    total_entries = session.query(func.count(Connection.id)).scalar()
     query = session.query(Connection)
-    total_entries = query.count()
-    query = query.offset(offset).limit(limit)
-
-    connections = query.all()
+    connections = query.offset(offset).limit(limit).all()
     return 
connection_collection_schema.dump(ConnectionCollection(connections=connections,
                                                                   
total_entries=total_entries))
 
 
-def patch_connection():
+@provide_session
+def patch_connection(connection_id, session, update_mask=None):
     """
     Update a connection entry
     """
-    raise NotImplementedError("Not implemented yet.")
+    body = request.json
+    connection = 
session.query(Connection).filter_by(conn_id=connection_id).first()
+    if connection is None:
+        raise NotFound("Connection not found")
+    if update_mask:

Review comment:
       Ah. Probably I was wrong, but I will still have to check how connexion 
behaves when it sees additional fields in the request from the user. It seems 
to me that it could be set in the connexion configuration, but I'm not sure. I 
will come back to this because it will take me a moment to check.




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