potiuk commented on issue #55841:
URL: https://github.com/apache/airflow/issues/55841#issuecomment-3397990196
Indeed - I double checked it- in this case where "wtforms" is not installed
(it's only expected by FAB provider) - the whole connection configuration does
not work because there is no mocking of wtforms fields.
In general when WTforms and flask-babel are not available connection mapping
is not going to work. I am not sure if that was an intended behaviour -
@jscheffl and @pierrejeambrun?
Generally speaking it means that the "airflow-core" (at least for connection
behaviours and connection Ui is not decoupled currently from having to install
WTForms/FlaskBabel (and even flask_appbuilder for password fields):
```python
with contextlib.ExitStack() as stack:
try:
importlib.import_module("wtforms")
stack.enter_context(mock.patch("wtforms.StringField",
HookMetaService.MockStringField))
...
try:
importlib.import_module("flask_babel")
stack.enter_context(mock.patch("flask_babel.lazy_gettext",
mock_lazy_gettext))
except ImportError:
pass
...
try:
importlib.import_module("flask_appbuilder")
stack.enter_context(
mock.patch(
"flask_appbuilder.fieldwidgets.BS3TextFieldWidget",
HookMetaService.MockAnyWidget
)
)
```
In this case also even providers are not able to return the widgets as
output anyway, because they are not able to import those classes.
Was it intentional? Or maybe the idea was to mock even "modules when they
are not available?
I think if we further decouple FAB and people will start using KeyCloak Auth
Manager - this will be more and more of a problem.
--
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]