-
Notifications
You must be signed in to change notification settings - Fork 16.3k
fix(dashboard): Dashboard import commands not correctly replacing charts #25102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
Please fix pre-commit by running |
|
Done, sorry about that! |
|
Is there a plan to have this released anytime soon ? @lindenh @betodealmeida ? |
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 #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: Alternatively it is possible to run pre-commit by running pre-commit manually: |
|
Sorry- wasn't quite finished. Should be all good now though and ready to review again. @rusackas / @betodealmeida |
|
Bumping again @rusackas + @betodealmeida |
|
/korbit-review |
There was a problem hiding this 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 |
|---|---|---|
| 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-reviewon 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-reviewcommand in a comment at the root of your PR.- You can ask Korbit to generate a new PR description using the
/korbit-generate-pr-descriptioncommand in any comment on your PR.- Too many Korbit comments? I can resolve all my comment threads if you use the
/korbit-resolvecommand 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
| if uuid not in chart_ids: | ||
| break |
There was a problem hiding this comment.
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 
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:
continueChat with Korbit by mentioning @korbit-ai, and give a 👍 or 👎 to help Korbit improve your reviews.
|
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. |
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
ADDITIONAL INFORMATION