Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion superset/databases/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

from flask import current_app
from flask_babel import lazy_gettext as _
from marshmallow import fields, pre_load, Schema, validates_schema
from marshmallow import EXCLUDE, fields, pre_load, Schema, validates_schema
from marshmallow.validate import Length, ValidationError
from sqlalchemy import MetaData
from sqlalchemy.engine.url import make_url
Expand Down Expand Up @@ -275,6 +275,9 @@ def build_sqlalchemy_uri(


class DatabasePostSchema(Schema, DatabaseParametersSchemaMixin):
class Meta: # pylint: disable=too-few-public-methods
unknown = EXCLUDE

database_name = fields.String(
description=database_name_description, required=True, validate=Length(1, 250),
)
Expand Down Expand Up @@ -314,6 +317,9 @@ class DatabasePostSchema(Schema, DatabaseParametersSchemaMixin):


class DatabasePutSchema(Schema, DatabaseParametersSchemaMixin):
class Meta: # pylint: disable=too-few-public-methods
unknown = EXCLUDE

database_name = fields.String(
description=database_name_description, allow_none=True, validate=Length(1, 250),
)
Expand Down