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


##########
airflow/providers/http/hooks/http.py:
##########
@@ -95,6 +98,11 @@ def get_conn(self, headers: dict[Any, Any] | None = None) -> 
requests.Session:
                 self.base_url = self.base_url + ":" + str(conn.port)
             if conn.login:
                 session.auth = self.auth_type(conn.login, conn.password)
+            elif self.auth_type is not None and self.auth_type is not 
HTTPBasicAuth:

Review Comment:
   Or, if we worry about people relying on `self.auth_type` (maybe when they 
subclass `HttpHook`), we could do something like this:
   
   ```python
   def __init__(self, ..., auth_type: Any = None, ...):
       ...
       self._auth_type = auth_type
   
   @property
   def auth_type(self):
       return self._auth_type or HTTPBasicAuth
   
   @auth_type.setter
   def auth_type(self, v):
       self._auth_type = v
   
   def get_conn(...):
       ...
       elif self._auth_type is not None:
   ```



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