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:49 UTC
[superset] 01/01: chore: Refine native dashboard cleanup logic
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"])