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


##########
airflow-ctl/src/airflowctl/api/operations.py:
##########
@@ -148,6 +150,33 @@ def __init_subclass__(cls, **kwargs):
             if callable(value):
                 setattr(cls, attr, 
_check_flag_and_exit_if_server_response_error(value))
 
+    def return_all_entries(
+        self,
+        *,
+        path: str,
+        total_entries: int,
+        data_model: type[BaseModel],
+        entry_list: list,
+        offset: int = 0,
+        limit: int = 50,
+        params: dict | None = None,
+        **kwargs,
+    ) -> list | ServerResponseError:
+        if params is None:
+            params = {}
+        params.update({"limit": limit}, **kwargs)

Review Comment:
   Probably not consequential, but updating `params` in-place is somewhat 
surprising. I’d do something like
   
   ```python
   shared_params = {"limit": limit, **(params or {}), **kwargs}
   
   while ...:
       loop_params = {**shared_params, "offset": offset}
   ```
   
   Also, the kwargs feature seems somewhat unnecessary. I would just get rid of 
it and require everything passed inside params.



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