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/07/28 16:05:45 UTC

[superset] 01/01: fix(migration): Ensure cascadeParentIds key exists

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

johnbodley pushed a commit to branch john-bodley--fix-24749
in repository https://gitbox.apache.org/repos/asf/superset.git

commit e6747b92309f3dc7ba69dd720b4f7fe472d4a17b
Author: John Bodley <45...@users.noreply.github.com>
AuthorDate: Thu Jul 27 22:03:33 2023 -0700

    fix(migration): Ensure cascadeParentIds key exists
---
 ...023-07-19_16-48_a23c6f8b1280_cleanup_erroneous_parent_filter_ids.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/superset/migrations/versions/2023-07-19_16-48_a23c6f8b1280_cleanup_erroneous_parent_filter_ids.py b/superset/migrations/versions/2023-07-19_16-48_a23c6f8b1280_cleanup_erroneous_parent_filter_ids.py
index 17ad592b22..f5bdb29a96 100644
--- a/superset/migrations/versions/2023-07-19_16-48_a23c6f8b1280_cleanup_erroneous_parent_filter_ids.py
+++ b/superset/migrations/versions/2023-07-19_16-48_a23c6f8b1280_cleanup_erroneous_parent_filter_ids.py
@@ -61,14 +61,13 @@ def upgrade():
                     filter_ids = {fltr["id"] for fltr in filters}
 
                     for fltr in filters:
-                        for parent_id in fltr["cascadeParentIds"][:]:
+                        for parent_id in fltr.get("cascadeParentIds", [])[:]:
                             if parent_id not in filter_ids:
                                 fltr["cascadeParentIds"].remove(parent_id)
                                 updated = True
 
                 if updated:
                     dashboard.json_metadata = json.dumps(json_metadata)
-
             except Exception:
                 logging.exception(
                     f"Unable to parse JSON metadata for dashboard {dashboard.id}"