bito-code-review[bot] commented on PR #40967:
URL: https://github.com/apache/superset/pull/40967#issuecomment-4678410185
<!-- Bito Reply -->
The architect review correctly identifies that time-comparison size series
(e.g., `<metric>__<offset>`) are not currently recognized as size-only series,
causing them to leak into `rawSeries` and render incorrectly in the legend. To
resolve this, you should update the `isSizeSeries` detection logic to include
these time-comparison patterns.
### Proposed Fix
In
`superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts`,
update the `isSizeSeries` helper (or equivalent logic) to account for the `__`
separator used in time comparisons:
```typescript
// Example of updated detection logic
const isSizeSeries = (seriesName: string, sizeMetric: string) => {
const basePattern = `^${sizeMetric}(, .*)?$`;
const timeComparisonPattern = `^${sizeMetric}__.*(, .*)?$`;
return new
RegExp(`${basePattern}|${timeComparisonPattern}`).test(seriesName);
};
```
This change ensures that both standard size metrics and their
time-comparison variants are correctly identified and excluded from `rawSeries`
and `sizeLookups`.
**superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts**
```
const isSizeSeries = (seriesName: string, sizeMetric: string) => {
const basePattern = `^${sizeMetric}(, .*)?$`;
const timeComparisonPattern = `^${sizeMetric}__.*(, .*)?$`;
return new
RegExp(`${basePattern}|${timeComparisonPattern}`).test(seriesName);
};
```
--
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]