codeant-ai-for-open-source[bot] commented on code in PR #41400:
URL: https://github.com/apache/superset/pull/41400#discussion_r3476084826
##########
superset-frontend/plugins/preset-chart-deckgl/src/utils.test.ts:
##########
@@ -488,3 +492,40 @@ describe('getBreakPoints', () => {
});
});
});
+
+describe('getBuckets', () => {
+ const accessor = (d: any) => d.value;
Review Comment:
**Suggestion:** Replace the `any` parameter type with a concrete object type
(for example the same JSON object shape expected by the production helper
signatures) so the accessor is type-safe. [custom_rule]
**Severity Level:** Minor ⚠️
<details>
<summary><b>Why it matters? 🤔 </b></summary>
This is a TypeScript test file, and the code uses the `any` type in a
modified line. The rule explicitly forbids newly added or modified
TypeScript/TSX code from using `any`, so this is a real violation.
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=62b7358d5bfc4de8b6bab211e389e6de&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=62b7358d5bfc4de8b6bab211e389e6de&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/preset-chart-deckgl/src/utils.test.ts
**Line:** 497:497
**Comment:**
*Custom Rule: Replace the `any` parameter type with a concrete object
type (for example the same JSON object shape expected by the production helper
signatures) so the accessor is type-safe.
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%2F41400&comment_hash=2755bce3d944b22b7ea6f0dd1bcf0c026a9fe9644b7b7898f7f24c75f8630d05&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41400&comment_hash=2755bce3d944b22b7ea6f0dd1bcf0c026a9fe9644b7b7898f7f24c75f8630d05&reaction=dislike'>👎</a>
##########
superset-frontend/plugins/preset-chart-deckgl/src/utils.test.ts:
##########
@@ -488,3 +492,40 @@ describe('getBreakPoints', () => {
});
});
});
+
+describe('getBuckets', () => {
+ const accessor = (d: any) => d.value;
+
+ const buildFeatures = (values: number[]) => values.map(value => ({ value }));
+
+ test('produces non-overlapping bucket labels (no shared endpoints)', () => {
+ // With break points [1, 81, 212, 369] the legacy behavior produced
+ // "1 - 81", "81 - 212", "212 - 369" where each interior breakpoint
+ // (81, 212) appeared in two adjacent labels, reading as overlapping
+ // ranges. Labels should instead form a clean, non-overlapping partition.
+ const fd: any = {
Review Comment:
**Suggestion:** Replace the `any` annotation on the form-data test fixture
with the concrete form-data type accepted by the bucket utility (or a narrowed
subset of that type) to avoid bypassing type checks. [custom_rule]
**Severity Level:** Minor ⚠️
<details>
<summary><b>Why it matters? 🤔 </b></summary>
This modified TypeScript test code directly annotates a variable with `any`,
which is prohibited by the custom rule. The suggestion correctly identifies an
actual violation in the current file.
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=9b69dd05176147949a8a956d9a289265&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=9b69dd05176147949a8a956d9a289265&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/preset-chart-deckgl/src/utils.test.ts
**Line:** 506:506
**Comment:**
*Custom Rule: Replace the `any` annotation on the form-data test
fixture with the concrete form-data type accepted by the bucket utility (or a
narrowed subset of that type) to avoid bypassing type checks.
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%2F41400&comment_hash=a2c4f561cf9faa0db950fa8ab8ebb7da3ea971ec9919a2fdea7ccc8540e907bd&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41400&comment_hash=a2c4f561cf9faa0db950fa8ab8ebb7da3ea971ec9919a2fdea7ccc8540e907bd&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]