msumit opened a new pull request #16048:
URL: https://github.com/apache/airflow/pull/16048
**Issue**
When we call `get_hook` method on an HTTP connection, it returns an Airbyte
hook & errors out.
```
>>> h.conn_type
'http'
>>> h.get_hook()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/sumit/work/airflow/airflow/models/connection.py", line 304,
in get_hook
return hook_class(**{conn_id_param: self.conn_id})
TypeError: __init__() got an unexpected keyword argument 'http_conn_id'
>>> from airflow.providers_manager import ProvidersManager
>>> a = ProvidersManager().hooks.get(h.conn_type, (None, None, None, None))
>>> a
HookInfo(connection_class='airflow.providers.airbyte.hooks.airbyte.AirbyteHook',
connection_id_attribute_name='http_conn_id',
package_name='apache-airflow-providers-airbyte', hook_name='HTTP')
```
**Fix**
The fix looks rather simple, but not sure what should be the values of
`conn_type` or `hook_name` of these provider hooks.
After change
`>>> h.get_hook()`
`<airflow.providers.http.hooks.http.HttpHook object at 0x11ab6ef90>`
If the approach looks good, will add relevant unit tests.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]