sadpandajoe commented on code in PR #35933:
URL: https://github.com/apache/superset/pull/35933#discussion_r2624674487
##########
superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Scatter/buildQuery.ts:
##########
@@ -75,17 +77,23 @@ export default function buildQuery(formData:
DeckScatterFormData) {
typeof col === 'string' ? col : col.label || col.sqlExpression || '',
);
const withJsColumns = addJsColumnsToColumns(columnStrings, js_columns);
+ const uniqueColumns = ensureColumnsUnique(withJsColumns);
- columns = withJsColumns as QueryFormColumn[];
+ columns = uniqueColumns as QueryFormColumn[];
columns = addTooltipColumnsToQuery(columns, tooltip_contents);
- const metrics = processMetricsArray([point_radius_fixed?.value]);
+ const isRadiusMetric =
+ point_radius_fixed?.type === 'metric' && point_radius_fixed?.value;
+ const metrics = isRadiusMetric
Review Comment:
Isn't this a type mismatch between metrics and orderby?
When point_radius_fixed.type === 'metric', the code:
- Passes String(point_radius_fixed.value) to processMetricsArray
(stringifying the ID)
- But passes raw point_radius_fixed.value (integer) to orderby
This means for numeric metric IDs, the backend receives metrics: ["5"] but
orderby: [[5, false]]. The metric lookup will fail because the string "5"
doesn't match the integer 5.
Could probably add a quick unit test to verify this
--
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]