sadpandajoe commented on code in PR #40919:
URL: https://github.com/apache/superset/pull/40919#discussion_r4340905301
##########
superset-frontend/plugins/plugin-chart-echarts/src/Treemap/EchartsTreemap.tsx:
##########
@@ -124,7 +125,7 @@ export default function EchartsTreemap({
const drillToDetailFilters: BinaryQueryObjectFilterClause[] = [];
const drillByFilters: BinaryQueryObjectFilterClause[] = [];
treePath.forEach((path, i) => {
- const val = path === 'null' ? NULL_STRING : path;
+ const val = path === 'null' ? getConstantLabel(NULL_STRING) : path;
Review Comment:
When `TRANSLATE_SHARED_CONSTANT_LABELS` is on and `<NULL>` is customized
(say to `N/A`), a null tree path now becomes `val: 'N/A'` in both the
drill-to-detail and drill-by filters. The backend only treats the invariant
`<NULL>` token as SQL NULL, so those drills filter for the literal string `N/A`
and return no rows or the wrong rows. `formattedVal` already carries the
display text, so should `val` stay the invariant `NULL_STRING` here (and the
same for the cross-filter path built from `formatSeriesName`)?
##########
superset-frontend/plugins/plugin-chart-echarts/src/Graph/transformProps.ts:
##########
@@ -146,10 +149,12 @@ function getKeyByValue(
/** Use the shared null label and quote literals that would collide with it. */
function getCategoryName(columnName: string, name?: DataRecordValue) {
if (name == null) {
- return NULL_STRING;
+ return getConstantLabel(NULL_STRING);
Review Comment:
Null categories now return the localized label, but the collision check
below (`unquoted === NULL_STRING`) still compares literals against the
untranslated `<NULL>`. With `<NULL>` customized to `N/A`, categories `[null,
'N/A']` both become the name `N/A`, so they collapse into one legend
entry/color and toggle together; previously they stayed distinct. Should the
collision check compare against `getConstantLabel(NULL_STRING)` as well?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]