fix(drill-to-detail): drill to detail by correctly filtering by metric#39766
Open
luizotavio32 wants to merge 1 commit intoapache:masterfrom
Open
fix(drill-to-detail): drill to detail by correctly filtering by metric#39766luizotavio32 wants to merge 1 commit intoapache:masterfrom
luizotavio32 wants to merge 1 commit intoapache:masterfrom
Conversation
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #39766 +/- ##
=======================================
Coverage 64.41% 64.41%
=======================================
Files 2566 2566
Lines 134284 134286 +2
Branches 31194 31195 +1
=======================================
+ Hits 86503 86505 +2
Misses 46283 46283
Partials 1498 1498
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:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SUMMARY
When a chart has a column whose
verbose_namediffers from its physicalcolumn_name(e.g. columncase_ownerdisplayed asCase Owner), right-clicking a bar and selecting Drill to detail by Case Owner sends a filter{col: "Case Owner", op: "==", val: "..."}in the samples request.get_sqla_querybuildscolumns_by_namekeyed exclusively by physicalcolumn_name, so the lookupcolumns_by_name.get("Case Owner")returnsNone. With neithercol_objnorsqla_colset, the filter is silently skipped — no WHERE clause is generated and the drill returns the full unfiltered dataset.Root cause
get_sqla_query(superset/models/helpers.py) resolves filter columns only by physical name. There is no fallback for the case where a chart plugin sends the column'sverbose_nameas the filter column — which is what the echarts context-menu handler does whengroupbycontains a column whose displayed label is the verbose name.Fix
After the physical-name lookup fails, fall back to matching
verbose_nameacrossself.columnsbefore continuing to the metric-filter path. The resolution order becomes: physicalcolumn_name→verbose_name→ metric name.TESTING INSTRUCTIONS
verbose_nameset (e.g. columncase_owner, verbose nameCase Owner).ADDITIONAL INFORMATION