hughhhh commented on code in PR #24279:
URL: https://github.com/apache/superset/pull/24279#discussion_r1214905009
##########
superset/migrations/versions/2023-05-11_12-41_4ea966691069_cross_filter_global_scoping.py:
##########
@@ -91,20 +94,24 @@ def downgrade():
chart_id = config.get("id")
if chart_id is None:
continue
- scope = config.get("crossFilters", {}).get("scope", {})
+ scope = config.get("crossFilters", {}).get("scope", "")
new_chart_configuration[chart_id] = copy.deepcopy(config)
- if scope == "global":
+ if scope.lower() == "global":
new_chart_configuration[chart_id]["crossFilters"]["scope"]
= {
"rootPath": ["ROOT_ID"],
"excluded": [chart_id],
}
json_metadata["chart_configuration"] = new_chart_configuration
- del json_metadata["global_chart_configuration"]
+
+ if "global_chart_configuration" in json_metadata:
+ del json_metadata["global_chart_configuration"]
+
Review Comment:
nit:
```suggestion
json_metadata.pop('global_chart_configuration')
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]