bugraoz93 commented on code in PR #50132:
URL: https://github.com/apache/airflow/pull/50132#discussion_r2146789020


##########
airflow-ctl/src/airflowctl/api/operations.py:
##########
@@ -593,11 +611,18 @@ def get(self, pool_name: str) -> PoolResponse | 
ServerResponseError:
         except ServerResponseError as e:
             raise e
 
-    def list(self) -> PoolCollectionResponse | ServerResponseError:
+    def list(self) -> list | ServerResponseError:
         """List all pools."""
         try:
             self.response = self.client.get("pools")
-            return 
PoolCollectionResponse.model_validate_json(self.response.content)
+            total_entries = 
PoolCollectionResponse.model_validate_json(self.response.content).total_entries

Review Comment:
   We are doing an additional call here. It would be great to include the first 
set of results, 50 as default, in the results. In `return_all_entries`, we can 
start from offset 50 and merge the result. Even just extending what was 
returned from the response, because the first 50 is already returned as a list. 
This can reduce at least one call per list operation. Because this is not only 
returning total entries, but the first 50 records from the database. We can 
even pass the first batch to the method



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