diff --git a/requirements/base.txt b/requirements/base.txt index df328bb61a3e1..49d58920c8330 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -86,7 +86,7 @@ flask==2.0.3 # flask-migrate # flask-sqlalchemy # flask-wtf -flask-appbuilder==4.0.0 +flask-appbuilder==4.1.2 # via apache-superset flask-babel==1.0.0 # via flask-appbuilder diff --git a/setup.py b/setup.py index ebd4eb6382a2d..bf5e06fed6351 100644 --- a/setup.py +++ b/setup.py @@ -77,7 +77,7 @@ def get_git_sha() -> str: "cryptography>=3.3.2", "deprecation>=2.1.0, <2.2.0", "flask>=2.0.0, <3.0.0", - "flask-appbuilder>=4.0.0, <5.0.0", + "flask-appbuilder>=4.1.2, <5.0.0", "flask-caching>=1.10.0", "flask-compress", "flask-talisman", diff --git a/superset/connectors/sqla/views.py b/superset/connectors/sqla/views.py index ef5afa5d05b28..47e5f216d5647 100644 --- a/superset/connectors/sqla/views.py +++ b/superset/connectors/sqla/views.py @@ -26,7 +26,7 @@ from flask_appbuilder.security.decorators import has_access from flask_babel import lazy_gettext as _ from wtforms.ext.sqlalchemy.fields import QuerySelectField -from wtforms.validators import Regexp +from wtforms.validators import DataRequired, Regexp from superset import app, db from superset.connectors.base.views import DatasourceModelView @@ -47,7 +47,22 @@ logger = logging.getLogger(__name__) -class TableColumnInlineView(CompactCRUDMixin, SupersetModelView): +class SelectDataRequired(DataRequired): # pylint: disable=too-few-public-methods + """ + Select required flag on the input field will not work well on Chrome + Console error: + An invalid form control with name='tables' is not focusable. + + This makes a simple override to the DataRequired to be used specifically with + select fields + """ + + field_flags = () + + +class TableColumnInlineView( + CompactCRUDMixin, SupersetModelView +): # pylint: disable=too-many-ancestors datamodel = SQLAInterface(models.TableColumn) # TODO TODO, review need for this on related_views class_permission_name = "Dataset" @@ -179,7 +194,9 @@ class TableColumnInlineView(CompactCRUDMixin, SupersetModelView): edit_form_extra_fields = add_form_extra_fields -class SqlMetricInlineView(CompactCRUDMixin, SupersetModelView): +class SqlMetricInlineView( + CompactCRUDMixin, SupersetModelView +): # pylint: disable=too-many-ancestors datamodel = SQLAInterface(models.SqlMetric) class_permission_name = "Dataset" method_permission_name = MODEL_VIEW_RW_METHOD_PERMISSION_MAP @@ -261,7 +278,9 @@ def __init__(self, **kwargs: Any): super().__init__(**kwargs) -class RowLevelSecurityFiltersModelView(SupersetModelView, DeleteMixin): +class RowLevelSecurityFiltersModelView( + SupersetModelView, DeleteMixin +): # pylint: disable=too-many-ancestors datamodel = SQLAInterface(models.RowLevelSecurityFilter) list_widget = cast(SupersetListWidget, RowLevelSecurityListWidget) diff --git a/superset/views/access_requests.py b/superset/views/access_requests.py index 4d671f3086c05..e60662e36e70a 100644 --- a/superset/views/access_requests.py +++ b/superset/views/access_requests.py @@ -25,7 +25,9 @@ from superset.views.core import DAR -class AccessRequestsModelView(SupersetModelView, DeleteMixin): +class AccessRequestsModelView( + SupersetModelView, DeleteMixin +): # pylint: disable=too-many-ancestors datamodel = SQLAInterface(DAR) include_route_methods = RouteMethod.CRUD_SET list_columns = [ diff --git a/superset/views/annotations.py b/superset/views/annotations.py index 87150c5cdda31..69718f5f5af52 100644 --- a/superset/views/annotations.py +++ b/superset/views/annotations.py @@ -47,7 +47,9 @@ def __call__(self, form: Dict[str, Any], field: Any) -> None: ) -class AnnotationModelView(SupersetModelView, CompactCRUDMixin): +class AnnotationModelView( + SupersetModelView, CompactCRUDMixin +): # pylint: disable=too-many-ancestors datamodel = SQLAInterface(Annotation) include_route_methods = RouteMethod.CRUD_SET | {"annotation"} diff --git a/superset/views/css_templates.py b/superset/views/css_templates.py index 74505e7109dc6..597f9efbd4571 100644 --- a/superset/views/css_templates.py +++ b/superset/views/css_templates.py @@ -25,7 +25,9 @@ from superset.views.base import DeleteMixin, SupersetModelView -class CssTemplateModelView(SupersetModelView, DeleteMixin): +class CssTemplateModelView( + SupersetModelView, DeleteMixin +): # pylint: disable=too-many-ancestors datamodel = SQLAInterface(models.CssTemplate) include_route_methods = RouteMethod.CRUD_SET diff --git a/superset/views/log/views.py b/superset/views/log/views.py index 383109fc08822..6cc8d2ffd6a63 100644 --- a/superset/views/log/views.py +++ b/superset/views/log/views.py @@ -26,7 +26,7 @@ from . import LogMixin -class LogModelView(LogMixin, SupersetModelView): +class LogModelView(LogMixin, SupersetModelView): # pylint: disable=too-many-ancestors datamodel = SQLAInterface(models.Log) include_route_methods = {RouteMethod.LIST, RouteMethod.SHOW} class_permission_name = "Log" diff --git a/superset/views/sql_lab.py b/superset/views/sql_lab.py index 60732fbcd1adb..a75225da9117f 100644 --- a/superset/views/sql_lab.py +++ b/superset/views/sql_lab.py @@ -35,7 +35,9 @@ logger = logging.getLogger(__name__) -class SavedQueryView(SupersetModelView, DeleteMixin): +class SavedQueryView( + SupersetModelView, DeleteMixin +): # pylint: disable=too-many-ancestors datamodel = SQLAInterface(SavedQuery) include_route_methods = RouteMethod.CRUD_SET