aminghadersohi commented on code in PR #38171:
URL: https://github.com/apache/superset/pull/38171#discussion_r3361681588
##########
superset/commands/dashboard/importers/v1/utils.py:
##########
@@ -160,7 +161,11 @@ def update_id_refs( # pylint: disable=too-many-locals #
noqa: C901
id_map[old_id] for old_id in scope_excluded if old_id in id_map
]
Review Comment:
This replaced the last call to `_remap_charts_in_scope` in `update_id_refs`.
The other two callers in `update_cross_filter_scoping` were also removed in
this PR, leaving `_remap_charts_in_scope` (defined at line 65) unreachable. Its
old in-place-mutator signature `(container, id_map)` diverges from the new
`_remap_chart_ids(id_list, id_map, uuid_to_new_id)` — a future reader could
reach for it and silently miss UUID-string support. Suggest deleting lines
65–77.
##########
tests/unit_tests/dashboards/commands/importers/v1/utils_test.py:
##########
@@ -666,3 +666,177 @@ def test_update_id_refs_handles_missing_time_grains():
filter_config = fixed["metadata"]["native_filter_configuration"][0]
assert filter_config.get("filterType") == "filter_timegrain"
assert "time_grains" not in filter_config
+
+
+def test_update_id_refs_cross_filter_uuid_keyed_config_remapped() -> None:
+ """
+ Test that UUID-keyed chart_configuration entries (from example exports) are
+ properly remapped to new integer IDs during import, including UUID values
in
+ chartsInScope.
+
+ export_example.remap_chart_configuration produces chart_configuration
keyed by
+ chart UUIDs with UUID values in crossFilters.chartsInScope.
+ """
+ from superset.commands.dashboard.importers.v1.utils import update_id_refs
Review Comment:
Inline import follows the pre-existing file convention (`# pylint:
disable=import-outside-toplevel` on line 17, used throughout the file). Same
pattern at lines 739 and 777. Not a regression introduced here — low priority
if the file is ever standardized.
--
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]