mikebridge opened a new pull request, #45528:
URL: https://github.com/apache/superset/pull/45528

   ### SUMMARY
   
   **What users saw.** Copying a dashboard with “duplicate charts” could create 
unused charts when the copied layout left out charts from the source dashboard, 
including when opening an older version as a new dashboard. With history 
capture enabled, the copy could also fail.
   
   **Why, in plain terms.** The copy created every source chart first, then 
removed charts that the copied layout did not use. Those charts had already 
been saved.
   
   **What this changes.** Only charts present in the copied layout are 
duplicated. Existing handling of archived or deleted charts and legacy chart 
IDs is preserved.
   
   The clone loop uses the reconciled layout's normalized chart IDs before 
creating any chart rows. Regression tests assert total chart counts and orphan 
counts for subset and empty layouts.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   Not applicable: this corrects backend copy behavior without a UI change.
   
   ### TESTING INSTRUCTIONS
   
   1. Create a dashboard with two charts.
   2. Copy it with chart duplication enabled and a layout containing only one 
source chart, then repeat with an empty layout.
   3. Confirm the copies contain one and zero charts respectively, no unused 
chart copies are created, and the source keeps both charts.
   
   Validated locally: 311 DAO/dashboard unit tests, all 11 dashboard-copy API 
tests using isolated SQLite, and changed-file pre-commit checks including MyPy. 
The new duplicate-copy regressions fail before the fix.
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
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]

Reply via email to