bito-code-review[bot] commented on PR #43175:
URL: https://github.com/apache/superset/pull/43175#issuecomment-5297117118
<!-- Bito Reply -->
The flagged issue is correct. When forecasting is enabled, the current
implementation only excludes the base shifted column name, leaving
forecast-derived variants (e.g., `__yhat`, `__yhat_lower`, `__yhat_upper`) to
be incorrectly included in stacked totals and chart legends.
To resolve this, you should extend the exclusion logic to also filter out
these forecast-derived suffixes for each shifted sort metric. In
`superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts`,
you can update the `extraMetricLabels` generation to include these variants in
the exclusion list:
```typescript
...rawExtraMetricLabels.flatMap(label =>
timeCompareOffsets.flatMap(offset => [
`${label}__${offset}`,
`${label}__${offset}__yhat`,
`${label}__${offset}__yhat_lower`,
`${label}__${offset}__yhat_upper`,
]),
),
```
This ensures that all forecast-related columns associated with the sort-only
metric are properly excluded.
**superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts**
```
...rawExtraMetricLabels.flatMap(label =>
timeCompareOffsets.flatMap(offset => [
`${label}__${offset}`,
`${label}__${offset}__yhat`,
`${label}__${offset}__yhat_lower`,
`${label}__${offset}__yhat_upper`,
]),
),
```
--
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]