EnxDev commented on code in PR #45528:
URL: https://github.com/apache/superset/pull/45528#discussion_r4366064739
##########
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:
This changes what "Open as new" does for a version whose layout predates
some of the current charts, and the docs still describe the old behaviour.
`docs/docs/using-superset/version-history.mdx:321` says "Live charts are
still cloned" under copying with charts. Worth a clause there saying only the
charts in the copied layout are cloned, so a user opening an older version
isn't surprised when newer charts don't come along.
--
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]