sirVir commented on code in PR #29206:
URL: https://github.com/apache/airflow/pull/29206#discussion_r1136317273
##########
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:
Sorry for a late answer, got carried with some other affairs.
@dimberman The problem is that if we take the default `HTTPBasicAuth` from
`auth_type` getter then we would initialize it without arguments, and
HTTPBasicAuth requires positional parameters.
That's why I think @uranusjr suggested to check for the private
`self._auth_type` instead.
I am fine with changing the default, but then we need to change it in the
`SimpleHttpOperator` as well, as otherwise it will be set every time when
someone tries to use it without `user` and `password` and then the `get_conn`
would try to initalize this defualt `HTTPBasicAuth` `auth_type` without
mandatory `user` and `password` parameters - which is why originally I was
testing whether it would be type of `SimpleHttpOperator` or not.
Please see my updated PR.
--
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]