You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Import dashboard/assets with overwrite flag does not replace dashboards #22127
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
I'm running into this as well (superset 2.0.0) by using the import / export feature from the UI.
The example given by @cleslie is about removing a chart, but the same things happens for updates, as well as datasets :
Export Dashboard through the UI with chartA, datasetA
Modify dashboard, chartA, datasetA
Import back dashboard file obtained in step 1, OVERWRITE is specified in the UI
Dashboard configuration is rolled back, chartA and datasetA are left in their state after (2)
Manually extracting datasets / charts from the archive, and importing them through the dedicated dataset / chart import tools applies updates as expected
I would add it may be interesting to give the user a chance to select what actually gets updated. For my specific use case I would like charts / datasets to be updated as dependencies of the dashboard, but I need databases to remain untouched (dashboards are moved between staging / production environements which use different source databases)
#23489 aims to fix this, but needs a rebase, a PR description, and some reviews. If anyone wants to review that code, test the solution, or open a rebased PR based on it, please go for it! Thanks in advance :D
CC @betodealmeida for awareness of import/export issues, as usual :D
Anyone still facing this? Tempted to close it as stale, but it's probably still an issue. Anyone who wants to open a PR here (including @Naveench131) would be appreciated :)
Yeah this is still an issue. The workaround that we've been doing on our end is to export as dashboards, change the type in the metadata file from Dashboard to assets, and then just use the assets API to import, though that obviously isn't ideal. I had a PR over in #25102 but it's a year old and I'm not certain that fix still works. I'll see if I get some time this or next week to fix it up.
Would really like to have this working. Definitely struggling to figure out how to update a dashboard including all other assets
You could pluck the commits from that PR above if you've got a fork, that should work. Not sure if it'll ever actually get looked at to be merged in. Otherwise the assets api hasn't had this issue at all in my experience if you're updating them programmatically.
Don't give up on that PR! We're trying to get better about circling back to things. I set it to Draft mode, and when it's rebased and marked as "ready for review" it'll get noticed in our (now daily) PR triage syncs.
Activity
ey3ball commentedon Nov 16, 2022
I'm running into this as well (superset 2.0.0) by using the import / export feature from the UI.
The example given by @cleslie is about removing a chart, but the same things happens for updates, as well as datasets :
Manually extracting datasets / charts from the archive, and importing them through the dedicated dataset / chart import tools applies updates as expected
I would add it may be interesting to give the user a chance to select what actually gets updated. For my specific use case I would like charts / datasets to be updated as dependencies of the dashboard, but I need databases to remain untouched (dashboards are moved between staging / production environements which use different source databases)
musicmuthu commentedon Dec 12, 2022
any solution for this issue.
Import dashboard/assets with overwrite flag does not replace dashboards
ashayargal commentedon Oct 17, 2023
Still have this issue
Will the above PR be reviewed anytime soon?
rusackas commentedon Feb 9, 2024
#23489 aims to fix this, but needs a rebase, a PR description, and some reviews. If anyone wants to review that code, test the solution, or open a rebased PR based on it, please go for it! Thanks in advance :D
CC @betodealmeida for awareness of import/export issues, as usual :D
rusackas commentedon Jun 3, 2024
Anyone still facing this? Tempted to close it as stale, but it's probably still an issue. Anyone who wants to open a PR here (including @Naveench131) would be appreciated :)
lindenh commentedon Oct 23, 2024
Yeah this is still an issue. The workaround that we've been doing on our end is to export as dashboards, change the type in the metadata file from Dashboard to assets, and then just use the assets API to import, though that obviously isn't ideal. I had a PR over in #25102 but it's a year old and I'm not certain that fix still works. I'll see if I get some time this or next week to fix it up.
lindenh commentedon Jan 7, 2025
That PR is ready for review again.
zachoooo commentedon Jan 17, 2025
Would really like to have this working. Definitely struggling to figure out how to update a dashboard including all other assets
lindenh commentedon Jan 27, 2025
You could pluck the commits from that PR above if you've got a fork, that should work. Not sure if it'll ever actually get looked at to be merged in. Otherwise the assets api hasn't had this issue at all in my experience if you're updating them programmatically.
rusackas commentedon May 14, 2025
Don't give up on that PR! We're trying to get better about circling back to things. I set it to Draft mode, and when it's rebased and marked as "ready for review" it'll get noticed in our (now daily) PR triage syncs.
fix(dashboard): import with overwrite flag replaces charts instead of…