-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Description
When importing a dashboard via /api/v1/dashboard/import/ with the ovewrite flag set to true, the charts within the dashboard are merged with existing charts. I would expect if passing the overwrite flag that whatever you upload would replace the existing dashboard. This is useful for a version control where you want the .yml in the repository to exactly reflect what is in the superset database. This is also the same for the /api/v1/assets/import/ API although this doesn't take an overwrite parameter.
How to reproduce the bug
- Export dashboard with chartA and chartB
- Unzip exported file
- Edit yml to remove /charts/chartB.yml and remove references to it in /dashboards/dashboard.yml
- Zip up files and upload with overwrite flag
- Dashboard is updated but still contains both charts
Expected results
Expect that dashboards should be replaced when imported and the overwrite flag is passed.
Actual results
Imported dashboards seem to be merged with what is already in the database.
Screenshots
N/A
Environment
(please complete the following information):
- browser type and version: firefox 106.0.5 but this is also the behaviour in the api
- superset version: 2.0.1rc2
- python version: 3.9.7
- node.js version: 16.14.2
- any feature flags active:
Checklist
Make sure to follow these steps before submitting your issue - thank you!
- I have checked the superset logs for python stacktraces and included it here as text if there are any.
- I have reproduced the issue with at least the latest released version of superset.
- I have checked the issue tracker for the same issue and I haven't found one similar.
Additional context
Slack discussion: https://apache-superset.slack.com/archives/C015WAZL0KH/p1667918679617939