mikebridge commented on code in PR #45528:
URL: https://github.com/apache/superset/pull/45528#discussion_r4380583003
##########
superset/daos/dashboard.py:
##########
@@ -969,9 +969,15 @@ def copy_dashboard(
# the raw-layout markdown placeholder while preserving geometry;
# the remap below skips that slot because it has no chartId.
reconcile_position_json(metadata.get("positions"),
original_dash.id)
+ chart_id: int | None
+ layout_chart_ids: set[int] = {
+ chart_id
+ for node in metadata["positions"].values()
+ if (chart_id := _layout_chart_id(node)) is not None
+ }
# Duplicating slices as well, mapping old ids to new ones
for slc in original_dash.slices:
- if slc.id in archived_ids:
+ if slc.id in archived_ids or slc.id not in layout_chart_ids:
Review Comment:
Thanks. Updated the version-history docs to say that only live charts in the
copied layout are cloned, so opening an older version won't bring along charts
added later.
--
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]