Skip to content

Commit

Permalink
fix: invalid dataset schema (apache#20826)
Browse files Browse the repository at this point in the history
(cherry picked from commit 3fb5c79)
  • Loading branch information
zhaoyongjie authored and sadpandajoe committed Jul 25, 2022
1 parent 2e0eb90 commit 13ef794
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion superset/dashboards/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from flask_appbuilder.api import expose, protect, rison, safe
from flask_appbuilder.hooks import before_request
from flask_appbuilder.models.sqla.interface import SQLAInterface
from flask_babel import ngettext
from flask_babel import gettext, ngettext
from marshmallow import ValidationError
from werkzeug.wrappers import Response as WerkzeugResponse
from werkzeug.wsgi import FileWrapper
Expand Down Expand Up @@ -383,6 +383,8 @@ def get_datasets(self, id_or_slug: str) -> Response:
self.dashboard_dataset_schema.dump(dataset) for dataset in datasets
]
return self.response(200, result=result)
except TypeError:
return self.response_400(message=gettext("Dataset schema is invalid."))
except DashboardAccessDeniedError:
return self.response_403()
except DashboardNotFoundError:
Expand Down
2 changes: 1 addition & 1 deletion superset/dashboards/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ class DashboardDatasetSchema(Schema):
health_check_message = fields.Str()
fetch_values_predicate = fields.Str()
template_params = fields.Str()
owners = fields.List(fields.Int())
owners = fields.List(fields.Dict())
columns = fields.List(fields.Dict())
column_types = fields.List(fields.Int())
metrics = fields.List(fields.Dict())
Expand Down

0 comments on commit 13ef794

Please sign in to comment.