Skip to content

Commit

Permalink
fix: bump FAB to 4.1.2 (#20483)
Browse files Browse the repository at this point in the history
  • Loading branch information
dpgaspar authored and michael-s-molina committed Jun 28, 2022
1 parent 290c274 commit 2a08ddd
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 11 deletions.
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
27 changes: 23 additions & 4 deletions superset/connectors/sqla/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion superset/views/access_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
4 changes: 3 additions & 1 deletion superset/views/annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"}

Expand Down
4 changes: 3 additions & 1 deletion superset/views/css_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion superset/views/log/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 3 additions & 1 deletion superset/views/sql_lab.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 2a08ddd

Please sign in to comment.