Skip to content

Commit

Permalink
fix: Ignore database extra fields when saving (apache#14465)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-s-molina committed May 4, 2021
1 parent 3ab58d2 commit f635b46
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion superset/databases/schemas.py
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

0 comments on commit f635b46

Please sign in to comment.