Skip to content

Conversation

cbum-dev
Copy link
Contributor

@cbum-dev cbum-dev commented Sep 10, 2025

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:-
Screenshot 2025-09-10 at 16 20 58
After:-
Screenshot 2025-09-10 at 16 21 27

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

  • Has associated issue:
  • 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

@dosubot dosubot bot added the viz:charts:pie Related to the Pie chart label Sep 10, 2025
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 Status
Functionality 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.

Loving Korbit!? Share us on LinkedIn Reddit and X

Comment on lines +57 to +59
const groupbyValues = values
.map(value => labelMap[value])
.filter(Boolean) as string[][];

This comment was marked as resolved.

Copy link

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.

@cbum-dev cbum-dev changed the title fix (pie chart) fixes pie chart other click error fix(pie chart) fixes pie chart other click error Sep 10, 2025
@mistercrunch mistercrunch changed the title fix(pie chart) fixes pie chart other click error fix(pie): fixes pie chart other click error Sep 11, 2025
@mistercrunch
Copy link
Member

Hoping @kgabryje can take a look. Looked a bit and was wondering if Others should have a value?

Copy link
Member

@kgabryje kgabryje left a comment

Choose a reason for hiding this comment

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

Looks good!

Copy link
Member

@msyavuz msyavuz left a comment

Choose a reason for hiding this comment

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

LGTM!

@msyavuz msyavuz merged commit b42060c into apache:master Sep 11, 2025
70 of 73 checks passed
@sadpandajoe sadpandajoe added the v6.0 Label added by the release manager to track PRs to be included in the 6.0 branch label Sep 11, 2025
sadpandajoe pushed a commit that referenced this pull request Sep 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugins size/XS v6.0 Label added by the release manager to track PRs to be included in the 6.0 branch viz:charts:pie Related to the Pie chart
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Runtime error on PIE chart on "other"
5 participants