superset
superset copied to clipboard
fix(dashboard): Dashboard import commands not correctly replacing charts
SUMMARY
Similar to https://github.com/apache/superset/pull/22208, the dashboard import commands would not replace charts when the overwrite flag was true, charts would be merged into one dashboard. This change fixes the command in the exact same way as that PR.
Fixes #22127
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
- Create a dashboard with a chart.
- Export the dashboard for import later.
- Modify the dashboard to remove the first chart and add a new one.
- Import the saved dashboard earlier (via UI OR /api/v1/dashboard/import)
- Notice both charts are in the dashboard
ADDITIONAL INFORMATION
- [x] Has associated issue: https://github.com/apache/superset/issues/22127
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in SIP-59)
- [ ] 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
Please fix pre-commit by running pre-commit run --all-files
Done, sorry about that!
Is there a plan to have this released anytime soon ? @lindenh @betodealmeida ?
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 83.75%. Comparing base (76d897e) to head (054e3bb).
:warning: Report is 2389 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #25102 +/- ##
===========================================
+ Coverage 60.48% 83.75% +23.26%
===========================================
Files 1931 538 -1393
Lines 76236 39127 -37109
Branches 8568 0 -8568
===========================================
- Hits 46114 32771 -13343
+ Misses 28017 6356 -21661
+ Partials 2105 0 -2105
| Flag | Coverage Δ | |
|---|---|---|
| hive | 48.75% <16.66%> (-0.40%) |
:arrow_down: |
| javascript | ? |
|
| mysql | 76.51% <100.00%> (?) |
|
| postgres | 76.57% <100.00%> (?) |
|
| presto | 53.27% <16.66%> (-0.54%) |
:arrow_down: |
| python | 83.75% <100.00%> (+20.24%) |
:arrow_up: |
| sqlite | 76.03% <100.00%> (?) |
|
| unit | 60.88% <16.66%> (+3.25%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
Is there a plan to have this released anytime soon ? @lindenh @betodealmeida ?
We can't merge it until tests are passing, but hopefully that can happen soon if @lindenh has bandwidth!
This affecting us too. We distribute dashboards (with their charts) to different users, and when a user "installs" a new version of a dashboard by importing it with the "overwrite" option, and this new version of the dashboard contains modifications to one or some of the dashboard's charts, those charts are not updated at all.
No need to add or remove charts, just any modifications like changes in the charts' queries will not be performed.
Right now we are asking our users to manually delete the old dashboard plus all its related charts one by one before importing the new version, which is a very inconvenient operation for large dashboards.
Sorry- I'll fix this right after https://github.com/apache/superset/pull/30887 gets in. Trying to avoid conflicts made by my own changes.
Looks like the pre-commit hook isn't run on this. That'll be needed to get it through.
Superset uses Git pre-commit hooks courtesy of pre-commit. To install run the following:
pip3 install -r requirements/development.txt
pre-commit install
A series of checks will now run when you make a git commit.
Alternatively it is possible to run pre-commit by running pre-commit manually:
pre-commit run --all-files
Sorry- wasn't quite finished. Should be all good now though and ready to review again. @rusackas / @betodealmeida
Bumping again @rusackas + @betodealmeida
/korbit-review
Sorry this has been lingering forever.... we're trying to get better about circling back to things. Meanwhile, this is in need of a rebase to resolve conflicts (which should help the Docker CI action pass, too), so I'll put it in Draft mode while it awaits that update.