mirror of https://github.com/apache/superset.git
chore: remove marshmallow-enum dependency and bump FAB (#24499)
This commit is contained in:
parent
036294a191
commit
0ddc0a6738
|
@ -11,7 +11,7 @@ alembic==1.6.5
|
||||||
# via flask-migrate
|
# via flask-migrate
|
||||||
amqp==5.1.0
|
amqp==5.1.0
|
||||||
# via kombu
|
# via kombu
|
||||||
apispec[yaml]==3.3.2
|
apispec[yaml]==6.3.0
|
||||||
# via flask-appbuilder
|
# via flask-appbuilder
|
||||||
async-timeout==4.0.2
|
async-timeout==4.0.2
|
||||||
# via redis
|
# via redis
|
||||||
|
@ -88,7 +88,7 @@ flask==2.2.5
|
||||||
# flask-migrate
|
# flask-migrate
|
||||||
# flask-sqlalchemy
|
# flask-sqlalchemy
|
||||||
# flask-wtf
|
# flask-wtf
|
||||||
flask-appbuilder==4.3.2
|
flask-appbuilder==4.3.3
|
||||||
# via apache-superset
|
# via apache-superset
|
||||||
flask-babel==1.0.0
|
flask-babel==1.0.0
|
||||||
# via flask-appbuilder
|
# via flask-appbuilder
|
||||||
|
@ -122,8 +122,6 @@ geographiclib==1.52
|
||||||
# via geopy
|
# via geopy
|
||||||
geopy==2.2.0
|
geopy==2.2.0
|
||||||
# via apache-superset
|
# via apache-superset
|
||||||
greenlet==2.0.2
|
|
||||||
# via sqlalchemy
|
|
||||||
gunicorn==20.1.0
|
gunicorn==20.1.0
|
||||||
# via apache-superset
|
# via apache-superset
|
||||||
hashids==1.3.1
|
hashids==1.3.1
|
||||||
|
@ -172,13 +170,10 @@ markupsafe==2.1.1
|
||||||
# mako
|
# mako
|
||||||
# werkzeug
|
# werkzeug
|
||||||
# wtforms
|
# wtforms
|
||||||
marshmallow==3.13.0
|
marshmallow==3.19.0
|
||||||
# via
|
# via
|
||||||
# flask-appbuilder
|
# flask-appbuilder
|
||||||
# marshmallow-enum
|
|
||||||
# marshmallow-sqlalchemy
|
# marshmallow-sqlalchemy
|
||||||
marshmallow-enum==1.5.1
|
|
||||||
# via flask-appbuilder
|
|
||||||
marshmallow-sqlalchemy==0.23.1
|
marshmallow-sqlalchemy==0.23.1
|
||||||
# via flask-appbuilder
|
# via flask-appbuilder
|
||||||
mdurl==0.1.2
|
mdurl==0.1.2
|
||||||
|
@ -197,8 +192,10 @@ ordered-set==4.1.0
|
||||||
packaging==23.1
|
packaging==23.1
|
||||||
# via
|
# via
|
||||||
# apache-superset
|
# apache-superset
|
||||||
|
# apispec
|
||||||
# deprecation
|
# deprecation
|
||||||
# limits
|
# limits
|
||||||
|
# marshmallow
|
||||||
pandas==1.5.3
|
pandas==1.5.3
|
||||||
# via apache-superset
|
# via apache-superset
|
||||||
paramiko==2.11.0
|
paramiko==2.11.0
|
||||||
|
|
|
@ -12,6 +12,10 @@
|
||||||
# -r requirements/docker.in
|
# -r requirements/docker.in
|
||||||
gevent==22.10.2
|
gevent==22.10.2
|
||||||
# via -r requirements/docker.in
|
# via -r requirements/docker.in
|
||||||
|
greenlet==2.0.2
|
||||||
|
# via
|
||||||
|
# -r requirements/docker.in
|
||||||
|
# gevent
|
||||||
psycopg2-binary==2.9.6
|
psycopg2-binary==2.9.6
|
||||||
# via apache-superset
|
# via apache-superset
|
||||||
zope-event==4.5.0
|
zope-event==4.5.0
|
||||||
|
|
|
@ -35,7 +35,7 @@ packaging==23.1
|
||||||
# pyproject-api
|
# pyproject-api
|
||||||
# tox
|
# tox
|
||||||
pip-compile-multi==2.6.3
|
pip-compile-multi==2.6.3
|
||||||
# via -r integration.in
|
# via -r requirements/integration.in
|
||||||
pip-tools==6.13.0
|
pip-tools==6.13.0
|
||||||
# via pip-compile-multi
|
# via pip-compile-multi
|
||||||
platformdirs==3.5.3
|
platformdirs==3.5.3
|
||||||
|
@ -45,17 +45,22 @@ platformdirs==3.5.3
|
||||||
pluggy==1.0.0
|
pluggy==1.0.0
|
||||||
# via tox
|
# via tox
|
||||||
pre-commit==3.3.3
|
pre-commit==3.3.3
|
||||||
# via -r integration.in
|
# via -r requirements/integration.in
|
||||||
pyproject-api==1.5.1
|
pyproject-api==1.5.1
|
||||||
# via tox
|
# via tox
|
||||||
pyproject-hooks==1.0.0
|
pyproject-hooks==1.0.0
|
||||||
# via build
|
# via build
|
||||||
pyyaml==5.4.1
|
pyyaml==5.4.1
|
||||||
# via pre-commit
|
# via pre-commit
|
||||||
|
tomli==2.0.1
|
||||||
|
# via
|
||||||
|
# build
|
||||||
|
# pyproject-api
|
||||||
|
# tox
|
||||||
toposort==1.10
|
toposort==1.10
|
||||||
# via pip-compile-multi
|
# via pip-compile-multi
|
||||||
tox==4.6.1
|
tox==4.6.1
|
||||||
# via -r integration.in
|
# via -r requirements/integration.in
|
||||||
virtualenv==20.23.0
|
virtualenv==20.23.0
|
||||||
# via
|
# via
|
||||||
# pre-commit
|
# pre-commit
|
||||||
|
|
|
@ -30,7 +30,7 @@ combine_as_imports = true
|
||||||
include_trailing_comma = true
|
include_trailing_comma = true
|
||||||
line_length = 88
|
line_length = 88
|
||||||
known_first_party = superset
|
known_first_party = superset
|
||||||
known_third_party =alembic,apispec,backoff,cachelib,celery,click,colorama,cron_descriptor,croniter,cryptography,dateutil,deprecation,flask,flask_appbuilder,flask_babel,flask_caching,flask_compress,flask_jwt_extended,flask_login,flask_migrate,flask_sqlalchemy,flask_talisman,flask_testing,flask_wtf,freezegun,geohash,geopy,holidays,humanize,isodate,jinja2,jwt,markdown,markupsafe,marshmallow,marshmallow_enum,msgpack,nh3,numpy,pandas,parameterized,parsedatetime,pgsanity,pkg_resources,polyline,prison,progress,pyarrow,sqlalchemy_bigquery,pyhive,pyparsing,pytest,pytest_mock,pytz,redis,requests,selenium,setuptools,simplejson,slack,sqlalchemy,sqlalchemy_utils,sqlparse,typing_extensions,urllib3,werkzeug,wtforms,wtforms_json,yaml
|
known_third_party =alembic,apispec,backoff,cachelib,celery,click,colorama,cron_descriptor,croniter,cryptography,dateutil,deprecation,flask,flask_appbuilder,flask_babel,flask_caching,flask_compress,flask_jwt_extended,flask_login,flask_migrate,flask_sqlalchemy,flask_talisman,flask_testing,flask_wtf,freezegun,geohash,geopy,holidays,humanize,isodate,jinja2,jwt,markdown,markupsafe,marshmallow,msgpack,nh3,numpy,pandas,parameterized,parsedatetime,pgsanity,pkg_resources,polyline,prison,progress,pyarrow,sqlalchemy_bigquery,pyhive,pyparsing,pytest,pytest_mock,pytz,redis,requests,selenium,setuptools,simplejson,slack,sqlalchemy,sqlalchemy_utils,sqlparse,typing_extensions,urllib3,werkzeug,wtforms,wtforms_json,yaml
|
||||||
multi_line_output = 3
|
multi_line_output = 3
|
||||||
order_by_type = false
|
order_by_type = false
|
||||||
|
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -81,7 +81,7 @@ setup(
|
||||||
"cryptography>=39.0.1, <40",
|
"cryptography>=39.0.1, <40",
|
||||||
"deprecation>=2.1.0, <2.2.0",
|
"deprecation>=2.1.0, <2.2.0",
|
||||||
"flask>=2.2.5, <3.0.0",
|
"flask>=2.2.5, <3.0.0",
|
||||||
"flask-appbuilder>=4.3.2, <5.0.0",
|
"flask-appbuilder>=4.3.3, <5.0.0",
|
||||||
"flask-caching>=1.10.1, <1.11",
|
"flask-caching>=1.10.1, <1.11",
|
||||||
"flask-compress>=1.13, <2.0",
|
"flask-compress>=1.13, <2.0",
|
||||||
"flask-talisman>=1.0.0, <2.0",
|
"flask-talisman>=1.0.0, <2.0",
|
||||||
|
|
|
@ -23,7 +23,6 @@ from typing import Any, TYPE_CHECKING
|
||||||
from flask_babel import gettext as _
|
from flask_babel import gettext as _
|
||||||
from marshmallow import EXCLUDE, fields, post_load, Schema, validate
|
from marshmallow import EXCLUDE, fields, post_load, Schema, validate
|
||||||
from marshmallow.validate import Length, Range
|
from marshmallow.validate import Length, Range
|
||||||
from marshmallow_enum import EnumField
|
|
||||||
|
|
||||||
from superset import app
|
from superset import app
|
||||||
from superset.common.chart_data import ChartDataResultFormat, ChartDataResultType
|
from superset.common.chart_data import ChartDataResultFormat, ChartDataResultType
|
||||||
|
@ -153,7 +152,7 @@ openapi_spec_methods_override = {
|
||||||
class TagSchema(Schema):
|
class TagSchema(Schema):
|
||||||
id = fields.Int()
|
id = fields.Int()
|
||||||
name = fields.String()
|
name = fields.String()
|
||||||
type = EnumField(TagTypes, by_value=True)
|
type = fields.Enum(TagTypes, by_value=True)
|
||||||
|
|
||||||
|
|
||||||
class ChartEntityResponseSchema(Schema):
|
class ChartEntityResponseSchema(Schema):
|
||||||
|
@ -1127,7 +1126,7 @@ class ChartDataQueryObjectSchema(Schema):
|
||||||
unknown = EXCLUDE
|
unknown = EXCLUDE
|
||||||
|
|
||||||
datasource = fields.Nested(ChartDataDatasourceSchema, allow_none=True)
|
datasource = fields.Nested(ChartDataDatasourceSchema, allow_none=True)
|
||||||
result_type = EnumField(ChartDataResultType, by_value=True, allow_none=True)
|
result_type = fields.Enum(ChartDataResultType, by_value=True, allow_none=True)
|
||||||
|
|
||||||
annotation_layers = fields.List(
|
annotation_layers = fields.List(
|
||||||
fields.Nested(AnnotationLayerSchema),
|
fields.Nested(AnnotationLayerSchema),
|
||||||
|
@ -1369,8 +1368,8 @@ class ChartDataQueryContextSchema(Schema):
|
||||||
allow_none=True,
|
allow_none=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
result_type = EnumField(ChartDataResultType, by_value=True)
|
result_type = fields.Enum(ChartDataResultType, by_value=True)
|
||||||
result_format = EnumField(ChartDataResultFormat, by_value=True)
|
result_format = fields.Enum(ChartDataResultFormat, by_value=True)
|
||||||
|
|
||||||
form_data = fields.Raw(allow_none=True, required=False)
|
form_data = fields.Raw(allow_none=True, required=False)
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,6 @@ from typing import Any, Union
|
||||||
|
|
||||||
from marshmallow import fields, post_load, pre_load, Schema
|
from marshmallow import fields, post_load, pre_load, Schema
|
||||||
from marshmallow.validate import Length, ValidationError
|
from marshmallow.validate import Length, ValidationError
|
||||||
from marshmallow_enum import EnumField
|
|
||||||
|
|
||||||
from superset.exceptions import SupersetException
|
from superset.exceptions import SupersetException
|
||||||
from superset.tags.models import TagTypes
|
from superset.tags.models import TagTypes
|
||||||
|
@ -174,7 +173,7 @@ class RolesSchema(Schema):
|
||||||
class TagSchema(Schema):
|
class TagSchema(Schema):
|
||||||
id = fields.Int()
|
id = fields.Int()
|
||||||
name = fields.String()
|
name = fields.String()
|
||||||
type = EnumField(TagTypes, by_value=True)
|
type = fields.Enum(TagTypes, by_value=True)
|
||||||
|
|
||||||
|
|
||||||
class DashboardGetResponseSchema(Schema):
|
class DashboardGetResponseSchema(Schema):
|
||||||
|
|
|
@ -25,7 +25,6 @@ from flask import current_app
|
||||||
from flask_babel import lazy_gettext as _
|
from flask_babel import lazy_gettext as _
|
||||||
from marshmallow import EXCLUDE, fields, pre_load, Schema, validates_schema
|
from marshmallow import EXCLUDE, fields, pre_load, Schema, validates_schema
|
||||||
from marshmallow.validate import Length, ValidationError
|
from marshmallow.validate import Length, ValidationError
|
||||||
from marshmallow_enum import EnumField
|
|
||||||
from sqlalchemy import MetaData
|
from sqlalchemy import MetaData
|
||||||
|
|
||||||
from superset import db, is_feature_enabled
|
from superset import db, is_feature_enabled
|
||||||
|
@ -254,7 +253,7 @@ class DatabaseParametersSchemaMixin: # pylint: disable=too-few-public-methods
|
||||||
values=fields.Raw(),
|
values=fields.Raw(),
|
||||||
metadata={"description": "DB-specific parameters for configuration"},
|
metadata={"description": "DB-specific parameters for configuration"},
|
||||||
)
|
)
|
||||||
configuration_method = EnumField(
|
configuration_method = fields.Enum(
|
||||||
ConfigurationMethod,
|
ConfigurationMethod,
|
||||||
by_value=True,
|
by_value=True,
|
||||||
metadata={"description": configuration_method_description},
|
metadata={"description": configuration_method_description},
|
||||||
|
@ -387,7 +386,7 @@ class DatabaseValidateParametersSchema(Schema):
|
||||||
allow_none=True,
|
allow_none=True,
|
||||||
validate=server_cert_validator,
|
validate=server_cert_validator,
|
||||||
)
|
)
|
||||||
configuration_method = EnumField(
|
configuration_method = fields.Enum(
|
||||||
ConfigurationMethod,
|
ConfigurationMethod,
|
||||||
by_value=True,
|
by_value=True,
|
||||||
required=True,
|
required=True,
|
||||||
|
|
|
@ -20,7 +20,6 @@ from croniter import croniter
|
||||||
from flask_babel import gettext as _
|
from flask_babel import gettext as _
|
||||||
from marshmallow import fields, Schema, validate, validates_schema
|
from marshmallow import fields, Schema, validate, validates_schema
|
||||||
from marshmallow.validate import Length, Range, ValidationError
|
from marshmallow.validate import Length, Range, ValidationError
|
||||||
from marshmallow_enum import EnumField
|
|
||||||
from pytz import all_timezones
|
from pytz import all_timezones
|
||||||
|
|
||||||
from superset.reports.models import (
|
from superset.reports.models import (
|
||||||
|
@ -168,7 +167,7 @@ class ReportSchedulePostSchema(Schema):
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
chart = fields.Integer(required=False, allow_none=True)
|
chart = fields.Integer(required=False, allow_none=True)
|
||||||
creation_method = EnumField(
|
creation_method = fields.Enum(
|
||||||
ReportCreationMethod,
|
ReportCreationMethod,
|
||||||
by_value=True,
|
by_value=True,
|
||||||
required=False,
|
required=False,
|
||||||
|
@ -265,7 +264,7 @@ class ReportSchedulePutSchema(Schema):
|
||||||
allow_none=True,
|
allow_none=True,
|
||||||
)
|
)
|
||||||
chart = fields.Integer(required=False, allow_none=True)
|
chart = fields.Integer(required=False, allow_none=True)
|
||||||
creation_method = EnumField(
|
creation_method = fields.Enum(
|
||||||
ReportCreationMethod,
|
ReportCreationMethod,
|
||||||
by_value=True,
|
by_value=True,
|
||||||
allow_none=True,
|
allow_none=True,
|
||||||
|
|
|
@ -23,7 +23,6 @@ from flask_appbuilder.api import safe
|
||||||
from flask_appbuilder.security.decorators import permission_name, protect
|
from flask_appbuilder.security.decorators import permission_name, protect
|
||||||
from flask_wtf.csrf import generate_csrf
|
from flask_wtf.csrf import generate_csrf
|
||||||
from marshmallow import EXCLUDE, fields, post_load, Schema, ValidationError
|
from marshmallow import EXCLUDE, fields, post_load, Schema, ValidationError
|
||||||
from marshmallow_enum import EnumField
|
|
||||||
|
|
||||||
from superset.embedded_dashboard.commands.exceptions import (
|
from superset.embedded_dashboard.commands.exceptions import (
|
||||||
EmbeddedDashboardNotFoundError,
|
EmbeddedDashboardNotFoundError,
|
||||||
|
@ -51,7 +50,7 @@ class UserSchema(PermissiveSchema):
|
||||||
|
|
||||||
|
|
||||||
class ResourceSchema(PermissiveSchema):
|
class ResourceSchema(PermissiveSchema):
|
||||||
type = EnumField(GuestTokenResourceType, by_value=True, required=True)
|
type = fields.Enum(GuestTokenResourceType, by_value=True, required=True)
|
||||||
id = fields.String(required=True)
|
id = fields.String(required=True)
|
||||||
|
|
||||||
@post_load
|
@post_load
|
||||||
|
|
|
@ -115,7 +115,7 @@ class TestBaseModelRestApi(SupersetTestCase):
|
||||||
self.assertEqual(rv.status_code, 200)
|
self.assertEqual(rv.status_code, 200)
|
||||||
response = json.loads(rv.data.decode("utf-8"))
|
response = json.loads(rv.data.decode("utf-8"))
|
||||||
expected_mutation_spec = {
|
expected_mutation_spec = {
|
||||||
"properties": {"id": {"format": "int32", "type": "integer"}},
|
"properties": {"id": {"type": "integer"}},
|
||||||
"type": "object",
|
"type": "object",
|
||||||
}
|
}
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
|
|
|
@ -711,7 +711,11 @@ class TestDatabaseApi(SupersetTestCase):
|
||||||
rv = self.client.post(uri, json=database_data)
|
rv = self.client.post(uri, json=database_data)
|
||||||
response = json.loads(rv.data.decode("utf-8"))
|
response = json.loads(rv.data.decode("utf-8"))
|
||||||
assert response == {
|
assert response == {
|
||||||
"message": {"configuration_method": ["Invalid enum value BAD_FORM"]}
|
"message": {
|
||||||
|
"configuration_method": [
|
||||||
|
"Must be one of: sqlalchemy_form, dynamic_form."
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
assert rv.status_code == 400
|
assert rv.status_code == 400
|
||||||
|
|
||||||
|
@ -1113,7 +1117,11 @@ class TestDatabaseApi(SupersetTestCase):
|
||||||
rv = self.client.put(uri, json=database_data)
|
rv = self.client.put(uri, json=database_data)
|
||||||
response = json.loads(rv.data.decode("utf-8"))
|
response = json.loads(rv.data.decode("utf-8"))
|
||||||
assert response == {
|
assert response == {
|
||||||
"message": {"configuration_method": ["Invalid enum value BAD_FORM"]}
|
"message": {
|
||||||
|
"configuration_method": [
|
||||||
|
"Must be one of: sqlalchemy_form, dynamic_form."
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
assert rv.status_code == 400
|
assert rv.status_code == 400
|
||||||
|
|
||||||
|
@ -2873,7 +2881,6 @@ class TestDatabaseApi(SupersetTestCase):
|
||||||
},
|
},
|
||||||
"port": {
|
"port": {
|
||||||
"description": "Database port",
|
"description": "Database port",
|
||||||
"format": "int32",
|
|
||||||
"maximum": 65536,
|
"maximum": 65536,
|
||||||
"minimum": 0,
|
"minimum": 0,
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
|
@ -2948,7 +2955,6 @@ class TestDatabaseApi(SupersetTestCase):
|
||||||
},
|
},
|
||||||
"port": {
|
"port": {
|
||||||
"description": "Database port",
|
"description": "Database port",
|
||||||
"format": "int32",
|
|
||||||
"maximum": 65536,
|
"maximum": 65536,
|
||||||
"minimum": 0,
|
"minimum": 0,
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
|
@ -3023,7 +3029,6 @@ class TestDatabaseApi(SupersetTestCase):
|
||||||
},
|
},
|
||||||
"port": {
|
"port": {
|
||||||
"description": "Database port",
|
"description": "Database port",
|
||||||
"format": "int32",
|
|
||||||
"maximum": 65536,
|
"maximum": 65536,
|
||||||
"minimum": 0,
|
"minimum": 0,
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
|
|
|
@ -501,7 +501,6 @@ def test_base_parameters_mixin():
|
||||||
"database": {"type": "string", "description": "Database name"},
|
"database": {"type": "string", "description": "Database name"},
|
||||||
"port": {
|
"port": {
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"format": "int32",
|
|
||||||
"minimum": 0,
|
"minimum": 0,
|
||||||
"maximum": 65536,
|
"maximum": 65536,
|
||||||
"description": "Database port",
|
"description": "Database port",
|
||||||
|
|
|
@ -1249,7 +1249,11 @@ class TestReportSchedulesApi(SupersetTestCase):
|
||||||
rv = self.post_assert_metric(uri, report_schedule_data, "post")
|
rv = self.post_assert_metric(uri, report_schedule_data, "post")
|
||||||
response = json.loads(rv.data.decode("utf-8"))
|
response = json.loads(rv.data.decode("utf-8"))
|
||||||
assert response == {
|
assert response == {
|
||||||
"message": {"creation_method": ["Invalid enum value BAD_CREATION_METHOD"]}
|
"message": {
|
||||||
|
"creation_method": [
|
||||||
|
"Must be one of: charts, dashboards, alerts_reports."
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
assert rv.status_code == 400
|
assert rv.status_code == 400
|
||||||
|
|
||||||
|
|
|
@ -102,7 +102,6 @@ def test_parameters_json_schema() -> None:
|
||||||
"http_path": {"type": "string"},
|
"http_path": {"type": "string"},
|
||||||
"port": {
|
"port": {
|
||||||
"description": "Database port",
|
"description": "Database port",
|
||||||
"format": "int32",
|
|
||||||
"maximum": 65536,
|
"maximum": 65536,
|
||||||
"minimum": 0,
|
"minimum": 0,
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
|
|
Loading…
Reference in New Issue