harlequin opened a new issue #20317:
URL: https://github.com/apache/airflow/issues/20317
### Apache Airflow version
2.2.2 (latest released)
### What happened
A custom connection hook inside the plugin folder will not displayed and
listed inside the UI.
```python
class PowerBiHook(BaseHook):
conn_name_attr = 'powerbi_conn_id'
default_conn_name = 'powerbi_default'
conn_type = 'powerbi'
hook_name = 'PowerBI'
@staticmethod
def get_connection_form_widgets() -> Dict[str, Any]:
"""Returns connection widgets to add to connection form"""
from flask_appbuilder.fieldwidgets import BS3TextFieldWidget
from flask_babel import lazy_gettext
from wtforms import StringField
return {
"extra__azure_batch__account_url": StringField(
lazy_gettext('Batch Account URL'),
widget=BS3TextFieldWidget()
),
}
@staticmethod
def get_ui_field_behaviour() -> Dict:
"""Returns custom field behaviour"""
return {
"hidden_fields": ['schema', 'port', 'host', 'extra'],
"relabeling": {
'login': 'Batch Account Name',
'password': 'Batch Account Access Key',
},
}
```
### What you expected to happen
The UI shall show the new connection type and UI changes
### How to reproduce
_No response_
### Operating System
docker
### Versions of Apache Airflow Providers
_No response_
### Deployment
Docker-Compose
### Deployment details
_No response_
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
--
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]