You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by be...@apache.org on 2023/03/16 00:58:15 UTC

[superset] branch sh68647 updated (5e7612fd1f -> a84a293b9f)

This is an automated email from the ASF dual-hosted git repository.

beto pushed a change to branch sh68647
in repository https://gitbox.apache.org/repos/asf/superset.git


 discard 5e7612fd1f fix: show_native_filters leftover
     new a84a293b9f fix: show_native_filters leftover

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (5e7612fd1f)
            \
             N -- N -- N   refs/heads/sh68647 (a84a293b9f)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 superset/dashboards/schemas.py | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)


[superset] 01/01: fix: show_native_filters leftover

Posted by be...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

beto pushed a commit to branch sh68647
in repository https://gitbox.apache.org/repos/asf/superset.git

commit a84a293b9f706ea0e7ca04357f4692c5ce8ff839
Author: Beto Dealmeida <ro...@dealmeida.net>
AuthorDate: Wed Mar 15 17:49:47 2023 -0700

    fix: show_native_filters leftover
---
 superset/dashboards/commands/importers/v1/utils.py |  5 +++++
 superset/dashboards/schemas.py                     | 19 ++++++++++++++++++-
 2 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/superset/dashboards/commands/importers/v1/utils.py b/superset/dashboards/commands/importers/v1/utils.py
index 090c64e21c..4d5e2ece81 100644
--- a/superset/dashboards/commands/importers/v1/utils.py
+++ b/superset/dashboards/commands/importers/v1/utils.py
@@ -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)
diff --git a/superset/dashboards/schemas.py b/superset/dashboards/schemas.py
index c74c7ba52a..823f6385e4 100644
--- a/superset/dashboards/schemas.py
+++ b/superset/dashboards/schemas.py
@@ -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(
+        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()