Copilot commented on code in PR #34761:
URL: https://github.com/apache/superset/pull/34761#discussion_r2286079003
##########
superset-frontend/plugins/plugin-chart-echarts/src/utils/series.ts:
##########
@@ -286,11 +287,15 @@ export function extractSeries(
sortSeriesAscending,
xAxisSortSeries,
xAxisSortSeriesAscending,
+ xAxisType,
} = opts;
if (data.length === 0) return [[], [], undefined];
const rows: DataRecord[] = data.map(datum => ({
...datum,
- [xAxis]: datum[xAxis],
+ [xAxis]:
+ datum[xAxis] === null && xAxisType === AxisType.Category
+ ? NULL_STRING
+ : datum[xAxis],
Review Comment:
[nitpick] The NULL value conversion logic is duplicated in the data mapping.
Consider extracting this into a helper function like
`convertNullForCategoricalAxis(value, xAxisType)` to improve maintainability
and make the intent clearer.
```suggestion
[xAxis]: convertNullForCategoricalAxis(datum[xAxis], xAxisType),
```
--
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]