-
Notifications
You must be signed in to change notification settings - Fork 15.7k
fix(pie): fixes pie chart other click error #35086
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.
Review by Korbit AI
Korbit automatically attempts to detect when you fix issues in new commits.
Category | Issue | Status |
---|---|---|
Unsafe type assertion after filtering ▹ view | 🧠 Not in standard |
Files scanned
File Path | Reviewed |
---|---|
superset-frontend/plugins/plugin-chart-echarts/src/utils/eventHandlers.ts | ✅ |
Explore our documentation to understand the languages and file types we support and the files we ignore.
Check out our docs on how you can make Korbit work best for you and your team.
const groupbyValues = values | ||
.map(value => labelMap[value]) | ||
.filter(Boolean) as string[][]; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
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.
filter(Boolean) removes any null/undefined values from the array. In this context, it prevents errors when labelMap doesn't contain an entry for the "Other" group by filtering out that undefined result before further processing.
Hoping @kgabryje can take a look. Looked a bit and was wondering if |
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.
Looks good!
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.
LGTM!
(cherry picked from commit b42060c)
Fixes pie chart run time error on clicking the "other" group.
Fixes #35028
SUMMARY
The issue was caused by the event handler in eventHandlers.ts which did not account for the "Other" group not having a corresponding entry in the labelMap. This led to an attempt to access a property on an undefined value, resulting in a TypeError.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before:-


After:-
TESTING INSTRUCTIONS
Create or open a dashboard with a Pie Chart, ensure an "Other" slice is generated (e.g., by lowering the Series Limit), then click both a regular slice and the "Other" slice.
Verify that regular slices support cross-filtering as expected, while clicking "Other" does not crash the app and shows no drill-down options.
ADDITIONAL INFORMATION