bito-code-review[bot] commented on PR #42881:
URL: https://github.com/apache/superset/pull/42881#issuecomment-5213540823
<!-- Bito Reply -->
The flagged issue is correct. The `extraMetricLabels` are currently derived
from raw metric labels, but `rebasedData` has already been processed through
`rebaseForecastDatum`, which applies `verboseMap` to rename keys. Consequently,
the exclusion set in `extractDataTotalValues` fails to match the verbose keys
present in the data, causing sort-only metrics to be incorrectly included in
the stacked totals.
To resolve this, you should map the `extraMetricLabels` using the same
`verboseMap` before passing them to `extractDataTotalValues`. In
`transformProps.ts`, update the extraction logic as follows:
```typescript
const extraMetricLabels = extractExtraMetrics(chartProps.rawFormData).map(
(metric) => verboseMap[getMetricLabel(metric)] || getMetricLabel(metric),
);
```
This ensures the exclusion set uses the same labels as the rebased data rows.
**superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts**
```
const extraMetricLabels = extractExtraMetrics(chartProps.rawFormData).map(
(metric) => verboseMap[getMetricLabel(metric)] || getMetricLabel(metric),
);
```
--
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]