You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by jo...@apache.org on 2023/08/02 02:48:48 UTC

[superset] branch john-bodley--refine-native-dashboard-cleanup created (now 3237bb9e95)

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

johnbodley pushed a change to branch john-bodley--refine-native-dashboard-cleanup
in repository https://gitbox.apache.org/repos/asf/superset.git


      at 3237bb9e95 chore: Refine native dashboard cleanup logic

This branch includes the following new commits:

     new 3237bb9e95 chore: Refine native dashboard cleanup logic

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.



[superset] 01/01: chore: Refine native dashboard cleanup logic

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

johnbodley pushed a commit to branch john-bodley--refine-native-dashboard-cleanup
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 3237bb9e9596d765a183551e8872b3b4aed03d94
Author: John Bodley <45...@users.noreply.github.com>
AuthorDate: Tue Aug 1 19:48:42 2023 -0700

    chore: Refine native dashboard cleanup logic
---
 superset/cli/native_filters.py | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/superset/cli/native_filters.py b/superset/cli/native_filters.py
index a25724d38d..6b6dd20256 100644
--- a/superset/cli/native_filters.py
+++ b/superset/cli/native_filters.py
@@ -368,17 +368,15 @@ def cleanup(
             json_metadata = json.loads(dashboard.json_metadata or "{}")
             position_json = json.loads(dashboard.position_json or "{}")
 
-            if "native_filter_migration" not in json_metadata:
-                click.echo(f"{str(dashboard)} has not been upgraded")
-                continue
-
             # Remove the saved filter configurations.
-            del json_metadata["native_filter_migration"]
-            dashboard.json_metadata = json.dumps(json_metadata)
+            if "native_filter_migration" in json_metadata:
+                del json_metadata["native_filter_migration"]
+                dashboard.json_metadata = json.dumps(json_metadata)
 
             for value in position_json.values():
                 if (
                     isinstance(value, dict)
+                    and value["type"] == "MARKDOWN"
                     and "native_filter_migration" in value["meta"]
                 ):
                     slice_ids.add(value["meta"]["native_filter_migration"]["chartId"])