dabla commented on code in PR #44557:
URL: https://github.com/apache/airflow/pull/44557#discussion_r1992905280


##########
providers/src/airflow/providers/http/sensors/http.py:
##########
@@ -177,5 +181,42 @@ def execute(self, context: Context) -> None:
                 method_name="execute_complete",
             )
 
-    def execute_complete(self, context: Context, event: dict[str, Any] | None 
= None) -> None:
+    @staticmethod
+    def _default_response_maker(response: Response | list[Response]) -> 
Callable:
+        """
+        Create a default response maker function based on the type of response.
+
+        :param response: The response object or list of response objects.
+        :return: A function that returns response text(s).
+        """
+        if isinstance(response, Response):

Review Comment:
   Would it be better to transform the response in a singleton list and then 
use the logic in the for loop?  Then the transformation logic would only need 
to be implemented once (DRY principle)?  Also I see this method is a copy of 
what is defined in HttpOperator, maybe it's time to move it in dedicated module 
(or under hook module) so it can be reused across operator and sensor?



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