Joffreybvn commented on code in PR #35560:
URL: https://github.com/apache/airflow/pull/35560#discussion_r1388954539


##########
airflow/providers/http/operators/http.py:
##########
@@ -162,16 +163,16 @@ def execute(self, context: Context) -> Any:
     def execute_sync(self, context: Context) -> Any:
         self.log.info("Calling HTTP method")
         response = self.hook.run(self.endpoint, self.data, self.headers, 
self.extra_options)
-        response = self.paginate_sync(first_response=response)
+        response = self.paginate_sync(response=response)
         return self.process_response(context=context, response=response)
 
-    def paginate_sync(self, first_response: Response) -> Response | 
list[Response]:
+    def paginate_sync(self, response: Response) -> Response | list[Response]:
         if not self.pagination_function:
-            return first_response
+            return response
 
-        all_responses = [first_response]
+        all_responses = [response]
         while True:
-            next_page_params = self.pagination_function(first_response)
+            next_page_params = self.pagination_function(response)
             if not next_page_params:
                 break
             response = 
self.hook.run(**self._merge_next_page_parameters(next_page_params))

Review Comment:
   > If I'm not mistaken, your change just renames the method `paginate_sync` 
`first_response` param to `response`, how does this fix the bug?
   
   Lines 177/178 set the response to a `response` variable.
   
   With this PR, the `response` is correctly reattributed and reach the 
pagination_function. Previously, the pagination function was repeatedly called 
with the `first_response`, which never changes.



-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to