-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(assets api): import replaces dashboard #22208
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Congrats on making your first PR and thank you for contributing to Superset! 🎉 ❤️
We hope to see you in our Slack community too!
Can we add a unit test for this behavior? there should already be some for import/export you can expand on |
Sure, I'll add a test 👍 |
Codecov Report
@@ Coverage Diff @@
## master #22208 +/- ##
==========================================
+ Coverage 65.49% 66.94% +1.44%
==========================================
Files 1835 1836 +1
Lines 69927 70077 +150
Branches 7590 7590
==========================================
+ Hits 45802 46913 +1111
+ Misses 22159 21198 -961
Partials 1966 1966
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
hello @eschutho, will this fix be available in 2.1.0? Thank you very much |
SUMMARY
For existing dashboards, modifications imported via
/api/v1/assets/import/
are only appended if the modified dashboard contains a new chart. Modifications to dashboards that remove a chart are not implemented when imported through the assets API.This change updates the assets API import method to remove all existing references to chart ids for the imported dashboard(s) before inserting the new chart ids. The change should benefit the management of Superset assets under source control.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
Remove a chart from a dashboard:
/api/v1/assets/import/
(see https://superset.apache.org/docs/api/#api)Add a chart to a dashboard:
/api/v1/assets/import/
ADDITIONAL INFORMATION