superset icon indicating copy to clipboard operation
superset copied to clipboard

fix(dashboard): Dashboard import commands not correctly replacing charts

Open lindenh opened this issue 2 years ago • 2 comments
trafficstars

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

  1. Create a dashboard with a chart.
  2. Export the dashboard for import later.
  3. Modify the dashboard to remove the first chart and add a new one.
  4. Import the saved dashboard earlier (via UI OR /api/v1/dashboard/import)
  5. 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

lindenh avatar Aug 28 '23 13:08 lindenh

Please fix pre-commit by running pre-commit run --all-files

mdeshmu avatar Aug 29 '23 03:08 mdeshmu

Done, sorry about that!

lindenh avatar Aug 29 '23 16:08 lindenh

Is there a plan to have this released anytime soon ? @lindenh @betodealmeida ?

FiiL123 avatar Oct 28 '24 11:10 FiiL123

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.

codecov[bot] avatar Oct 30 '24 17:10 codecov[bot]

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!

rusackas avatar Oct 30 '24 18:10 rusackas

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.

denodo-research-labs avatar Nov 13 '24 10:11 denodo-research-labs

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.

lindenh avatar Nov 14 '24 12:11 lindenh

Looks like the pre-commit hook isn't run on this. That'll be needed to get it through.

rusackas avatar Jan 03 '25 20:01 rusackas

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

rusackas avatar Jan 03 '25 20:01 rusackas

Sorry- wasn't quite finished. Should be all good now though and ready to review again. @rusackas / @betodealmeida

lindenh avatar Jan 04 '25 08:01 lindenh

Bumping again @rusackas + @betodealmeida

lindenh avatar Jan 13 '25 19:01 lindenh

/korbit-review

rusackas avatar Jan 13 '25 20:01 rusackas

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.

rusackas avatar May 14 '25 23:05 rusackas