Skip to content

Conversation

@lindenh
Copy link
Contributor

@lindenh lindenh commented Aug 28, 2023

SUMMARY

Similar to #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

  • Has associated issue: Import dashboard/assets with overwrite flag does not replace dashboards #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

Copy link
Contributor

@github-actions github-actions bot left a 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! Not signed up? Use our Slack App to self-register.

@john-bodley john-bodley added the review:checkpoint Last PR reviewed during the daily review standup label Aug 28, 2023
@mdeshmu
Copy link
Contributor

mdeshmu commented Aug 29, 2023

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

@lindenh
Copy link
Contributor Author

lindenh commented Aug 29, 2023

Done, sorry about that!

@john-bodley john-bodley removed the review:checkpoint Last PR reviewed during the daily review standup label Aug 29, 2023
@FiiL123
Copy link

FiiL123 commented Oct 28, 2024

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

@codecov
Copy link

codecov bot commented Oct 30, 2024

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.75%. Comparing base (76d897e) to head (054e3bb).
⚠️ 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%) ⬇️
javascript ?
mysql 76.51% <100.00%> (?)
postgres 76.57% <100.00%> (?)
presto 53.27% <16.66%> (-0.54%) ⬇️
python 83.75% <100.00%> (+20.24%) ⬆️
sqlite 76.03% <100.00%> (?)
unit 60.88% <16.66%> (+3.25%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rusackas
Copy link
Member

rusackas commented Oct 30, 2024

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!

@denodo-research-labs
Copy link
Contributor

denodo-research-labs commented Nov 13, 2024

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.

@lindenh
Copy link
Contributor Author

lindenh commented Nov 14, 2024

Sorry- I'll fix this right after #30887 gets in. Trying to avoid conflicts made by my own changes.

@rusackas
Copy link
Member

rusackas commented Jan 3, 2025

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

@rusackas
Copy link
Member

rusackas commented Jan 3, 2025

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

@lindenh
Copy link
Contributor Author

lindenh commented Jan 4, 2025

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

@lindenh
Copy link
Contributor Author

lindenh commented Jan 13, 2025

Bumping again @rusackas + @betodealmeida

@rusackas
Copy link
Member

/korbit-review

Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Fix Detected
Functionality Premature Loop Break on Missing Chart UUID ▹ view
Files scanned
File Path Reviewed
superset/commands/dashboard/importers/v1/init.py

Explore our documentation to understand the languages and file types we support and the files we ignore.

Need a new review? Comment /korbit-review on this PR and I'll review your latest changes.

Korbit Guide: Usage and Customization

Interacting with Korbit

  • You can manually ask Korbit to review your PR using the /korbit-review command in a comment at the root of your PR.
  • You can ask Korbit to generate a new PR description using the /korbit-generate-pr-description command in any comment on your PR.
  • Too many Korbit comments? I can resolve all my comment threads if you use the /korbit-resolve command in any comment on your PR.
  • Chat with Korbit on issues we post by tagging @korbit-ai in your reply.
  • Help train Korbit to improve your reviews by giving a 👍 or 👎 on the comments Korbit posts.

Customizing Korbit

  • Check out our docs on how you can make Korbit work best for you and your team.
  • Customize Korbit for your organization through the Korbit Console.

Current Korbit Configuration

General Settings
Setting Value
Review Schedule Automatic excluding drafts
Max Issue Count 10
Automatic PR Descriptions
Issue Categories
Category Enabled
Naming
Database Operations
Documentation
Logging
Error Handling
Systems and Environment
Objects and Data Structures
Readability and Maintainability
Asynchronous Processing
Design Patterns
Third-Party Libraries
Performance
Security
Functionality

Feedback and Support

Note

Korbit Pro is free for open source projects 🎉

Looking to add Korbit to your team? Get started with a free 2 week trial here

Comment on lines 134 to 135
if uuid not in chart_ids:
break
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Premature Loop Break on Missing Chart UUID category Functionality

Tell me more
What is the issue?

The code prematurely breaks the chart association loop when encountering an unknown chart UUID, potentially missing valid chart associations that come after.

Why this matters

If a single chart UUID is not found, all subsequent valid chart associations for the dashboard will be lost, leading to incomplete dashboard-chart relationships.

Suggested change ∙ Feature Preview

Replace the break with continue to skip only the invalid chart UUID:

if uuid not in chart_ids:
    continue
Chat with Korbit by mentioning @korbit-ai, and give a 👍 or 👎 to help Korbit improve your reviews.

@rusackas
Copy link
Member

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 rusackas marked this pull request as draft May 14, 2025 23:16
@lindenh lindenh closed this by deleting the head repository Aug 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Import dashboard/assets with overwrite flag does not replace dashboards

7 participants