You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "Copilot (via GitHub)" <gi...@apache.org> on 2026/03/04 18:36:15 UTC
Re: [PR] fix(dashboard): replace chartsInScope references at import time [superset]
Copilot commented on code in PR #38171:
URL: https://github.com/apache/superset/pull/38171#discussion_r2885418797
##########
superset/commands/dashboard/importers/v1/utils.py:
##########
@@ -139,55 +139,70 @@ def update_id_refs( # pylint: disable=too-many-locals # noqa: C901
native_filter["scope"]["excluded"] = [
id_map[old_id] for old_id in scope_excluded if old_id in id_map
]
+
+ # fix chartsInScope references (from PR #26389)
+ charts_in_scope = native_filter.get("chartsInScope", [])
+ if charts_in_scope:
+ native_filter["chartsInScope"] = [
+ id_map[old_id] for old_id in charts_in_scope if old_id in id_map
+ ]
Review Comment:
The newly added `chartsInScope` remapping logic here duplicates exactly what the `_remap_chart_ids` helper function (introduced in this same PR at line 154) does. Consider using the helper to reduce duplication:
```python
native_filter["chartsInScope"] = _remap_chart_ids(charts_in_scope, id_map)
```
This would make the code more consistent with how the same remapping is done in `_update_cross_filter_scope`.
```suggestion
native_filter["chartsInScope"] = _remap_chart_ids(
charts_in_scope, id_map
)
```
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org