ashb commented on a change in pull request #12837:
URL: https://github.com/apache/airflow/pull/12837#discussion_r537057669
##########
File path: airflow/hooks/base_hook.py
##########
@@ -18,14 +18,82 @@
"""Base class for all hooks"""
import logging
import warnings
-from typing import Any, List
+from typing import Any, Dict, List
+
+from wtforms import Field
from airflow.models.connection import Connection
+from airflow.typing_compat import Protocol
from airflow.utils.log.logging_mixin import LoggingMixin
log = logging.getLogger(__name__)
+class DiscoverableHook(Protocol):
+ """
+ This protocol should be implemented by Hook classes that want to be
discovered by ProvidersManager
+
+
+ The conn_name_attr, default_conn_name, conn_type should be implemented by
those
+ Hooks that want to be automatically mapped from the connection_type ->
Hook when get_hook method
+ is called with connection_type.
+
+ Additional - hook_name should be set when you want the hook to have a
custom name in the UI selection
Review comment:
```suggestion
Additionally hook_name should be set when you want the hook to have a
custom name in the UI selection
```
----------------------------------------------------------------
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]