You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "chkang-idk2 (via GitHub)" <gi...@apache.org> on 2026/07/23 09:55:11 UTC

[I] fix(echarts): cross-filter emits invalid filters when pie Total / Other / empty name is clicked [superset]

chkang-idk2 opened a new issue, #42340:
URL: https://github.com/apache/superset/issues/42340

   ### Bug description
   
   ### Bug description
   When using ECharts charts that share `eventHandlers.ts` (notably **Pie**), clicking some non-category UI elements can emit a **cross-filter with no valid dimension values**. Downstream charts then receive invalid filters (e.g. empty `IN ()` or unintended `IS NULL`) and fail or return wrong results.
   Affected click targets include:
   - Pie **Total** graphic text (`showTotal`)
   - Pie **Other** slice (when `thresholdForOther` is used) — name is not present in `labelMap`
   - Clicks where `name` is missing / empty
   ### How to reproduce the bug
   1. Create a dashboard with:
      - An ECharts **Pie** chart (groupby + metric), with **Show Total** enabled (and optionally **Threshold for Other**)
      - At least one other chart on the same dataset / compatible columns
   2. Enable dashboard **cross-filtering**
   3. Click the pie **Total** text (or the **Other** slice)
   4. Observe other charts error / return unexpected empty results / apply a bad filter
   ### Expected results
   - Clicks that do not map to a real groupby value should **not** emit a cross-filter
   - Only clicks on real pie sectors / labels with a resolvable `labelMap` entry should emit filters
   ### Actual results
   `getCrossFilterDataMask` still builds a data mask when `labelMap[value]` is missing:
   - selected `values` length > 0
   - `groupbyValues` becomes `[]` after `.filter(Boolean)`
   - filters are still emitted (`IN` with empty vals, or on current `master` effectively `IS NULL` because `[].every(...)` is `true`)
   Relevant code (`superset-frontend/plugins/plugin-chart-echarts/src/utils/eventHandlers.ts`):
   ```ts
   const groupbyValues = values
     .map(value => labelMap[value])
     .filter(Boolean) as string[][];
   
   ### Screenshots/recordings
   
   https://github.com/user-attachments/assets/9439dee7-583f-4d3a-a8d5-2abb7315103a
   
   ### Superset version
   
   6.1.0
   
   ### Python version
   
   3.12
   
   ### Node version
   
   18 or greater
   
   ### Browser
   
   Chrome
   
   ### Additional context
   
   Suggested fix
   In getCrossFilterDataMask / clickEventHandler:
   - no-op when name is null/empty
   - no-op when !labelMap[value]
   - no-op when selected values cannot all be resolved in labelMap
   
   ### Checklist
   
   - [x] I have searched Superset docs and Slack and didn't find a solution to my problem.
   - [x] I have searched the GitHub issue tracker and didn't find a similar bug report.
   - [ ] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] fix(echarts): cross-filter emits invalid filters when pie Total / Other / empty name is clicked [superset]

Posted by "omsn2 (via GitHub)" <gi...@apache.org>.
omsn2 commented on issue #42340:
URL: https://github.com/apache/superset/issues/42340#issuecomment-5266064128

   #43088 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] fix(echarts): cross-filter emits invalid filters when pie Total / Other / empty name is clicked [superset]

Posted by "omsn2 (via GitHub)" <gi...@apache.org>.
omsn2 commented on issue #42340:
URL: https://github.com/apache/superset/issues/42340#issuecomment-5266202170

   > Yes please, PRs always appreciated.
   
   fix(echarts): enable cross-filtering for pie chart "Other" slice- #43088
   #43088
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] fix(echarts): cross-filter emits invalid filters when pie Total / Other / empty name is clicked [superset]

Posted by "omsn2 (via GitHub)" <gi...@apache.org>.
omsn2 commented on issue #42340:
URL: https://github.com/apache/superset/issues/42340#issuecomment-5266194530

   fix(echarts): enable cross-filtering for pie chart "Other" slice- #43088 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] fix(echarts): cross-filter emits invalid filters when pie Total / Other / empty name is clicked [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas closed issue #42340: fix(echarts): cross-filter emits invalid filters when pie Total / Other / empty name is clicked
URL: https://github.com/apache/superset/issues/42340


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] fix(echarts): cross-filter emits invalid filters when pie Total / Other / empty name is clicked [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #42340:
URL: https://github.com/apache/superset/issues/42340#issuecomment-5065534956

   Yes please, PRs always appreciated.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] fix(echarts): cross-filter emits invalid filters when pie Total / Other / empty name is clicked [superset]

Posted by "chkang-idk2 (via GitHub)" <gi...@apache.org>.
chkang-idk2 commented on issue #42340:
URL: https://github.com/apache/superset/issues/42340#issuecomment-5057034523

   I can submit a PR for this if that sounds good.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org