mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -04:00
fix(dashboard): show_native_filters
leftover (#23389)
This commit is contained in:
parent
d950eb85d7
commit
022213972b
@ -162,6 +162,11 @@ def import_dashboard(
|
||||
|
||||
# TODO (betodealmeida): move this logic to import_from_dict
|
||||
config = config.copy()
|
||||
|
||||
# removed in https://github.com/apache/superset/pull/23228
|
||||
if "metadata" in config and "show_native_filters" in config["metadata"]:
|
||||
del config["metadata"]["show_native_filters"]
|
||||
|
||||
for key, new_name in JSON_KEYS.items():
|
||||
if config.get(key) is not None:
|
||||
value = config.pop(key)
|
||||
|
@ -18,7 +18,7 @@ import json
|
||||
import re
|
||||
from typing import Any, Dict, Union
|
||||
|
||||
from marshmallow import fields, post_load, Schema
|
||||
from marshmallow import fields, post_load, pre_load, Schema
|
||||
from marshmallow.validate import Length, ValidationError
|
||||
|
||||
from superset.exceptions import SupersetException
|
||||
@ -135,6 +135,23 @@ class DashboardJSONMetadataSchema(Schema):
|
||||
remote_id = fields.Integer()
|
||||
filter_bar_orientation = fields.Str(allow_none=True)
|
||||
|
||||
@pre_load
|
||||
def remove_show_native_filters( # pylint: disable=unused-argument, no-self-use
|
||||
self,
|
||||
data: Dict[str, Any],
|
||||
**kwargs: Any,
|
||||
) -> Dict[str, Any]:
|
||||
"""
|
||||
Remove ``show_native_filters`` from the JSON metadata.
|
||||
|
||||
This field was removed in https://github.com/apache/superset/pull/23228, but might
|
||||
be present in old exports.
|
||||
"""
|
||||
if "show_native_filters" in data:
|
||||
del data["show_native_filters"]
|
||||
|
||||
return data
|
||||
|
||||
|
||||
class UserSchema(Schema):
|
||||
id = fields.Int()
|
||||
|
Loading…
Reference in New Issue
Block a user