codeant-ai-for-open-source[bot] commented on code in PR #40967:
URL: https://github.com/apache/superset/pull/40967#discussion_r3401956519
##########
superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/transformers.test.ts:
##########
@@ -125,6 +125,35 @@ describe('transformSeries', () => {
// OpacityEnum.NonTransparent = 1 (not dimmed)
expect((result as any).itemStyle.opacity).toBe(1);
});
+
+ test('should use symbolSizeFn for symbolSize when provided', () => {
+ const symbolSizeFn = jest.fn(
+ (value: (number | string | null)[]) => Number(value[1]) * 2,
+ );
+ const opts = {
+ seriesType: EchartsTimeseriesSeriesType.Scatter,
+ markerSize: 7,
+ symbolSizeFn,
+ timeShiftColor: false,
+ };
+
+ const result = transformSeries(series, mockColorScale, 'test-key', opts);
+
+ expect((result as any).symbolSize).toBe(symbolSizeFn);
+ expect((result as any).symbolSize(['A', 4])).toBe(8);
Review Comment:
**Suggestion:** Replace the `any` cast in these assertions with a
concrete/narrower type for the `transformSeries` result (or a typed helper) so
`symbolSize` is validated without untyped access. [custom_rule]
**Severity Level:** Minor ⚠️
<details>
<summary><b>Why it matters? 🤔 </b></summary>
This is TypeScript test code, and the new assertions explicitly cast
`result` to `any` to access `symbolSize`. That matches the custom rule
forbidding `any` in new or modified TypeScript/TSX code.
</details>
[Fix in
Cursor](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=d5bf790f7623408c91187b6d1d9d2982&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
| [Fix in VSCode
Claude](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=d5bf790f7623408c91187b6d1d9d2982&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
*(Use Cmd/Ctrl + Click for best experience)*
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:**
superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/transformers.test.ts
**Line:** 142:143
**Comment:**
*Custom Rule: Replace the `any` cast in these assertions with a
concrete/narrower type for the `transformSeries` result (or a typed helper) so
`symbolSize` is validated without untyped access.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask
user if the user wants to fix the rest of the comments as well. if said yes,
then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F40967&comment_hash=5facd16852d8f79a705d565c2e9104343f41f90c9a26e50789b6fed584bd2b93&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F40967&comment_hash=5facd16852d8f79a705d565c2e9104343f41f90c9a26e50789b6fed584bd2b93&reaction=dislike'>👎</a>
--
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]