codeant-ai-for-open-source[bot] commented on code in PR #39535:
URL: https://github.com/apache/superset/pull/39535#discussion_r3430371993


##########
superset-frontend/packages/superset-ui-core/src/components/Select/Select.tsx:
##########
@@ -34,6 +34,8 @@ import { t } from '@apache-superset/core/translation';
 import { ensureIsArray, formatNumber, usePrevious } from '@superset-ui/core';
 import { Constants } from '@superset-ui/core/components';
 import {
+  BaseOptionType,
+  DefaultOptionType,

Review Comment:
   **Suggestion:** Remove the newly added direct `antd` type imports and 
replace them with an existing shared/local select option type (or a reusable 
wrapper-exported type) so this component does not expand direct dependency on 
`antd` internals. [custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   The final file directly imports `BaseOptionType` and `DefaultOptionType` 
from `antd/es/select`, which matches the rule that frontend UI code should not 
import from `antd` directly. The suggestion correctly identifies a real 
violation in the current code.
   </details>
   
   [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=a1b24f49debc47e3bd5acb99fe441cd3&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=a1b24f49debc47e3bd5acb99fe441cd3&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/packages/superset-ui-core/src/components/Select/Select.tsx
   **Line:** 37:38
   **Comment:**
        *Custom Rule: Remove the newly added direct `antd` type imports and 
replace them with an existing shared/local select option type (or a reusable 
wrapper-exported type) so this component does not expand direct dependency on 
`antd` internals.
   
   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%2F39535&comment_hash=55fcbabbbaa130bc9d8b74e23759e264c35cfe58d3c21f4ee6dcfebcd50ba60d&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39535&comment_hash=55fcbabbbaa130bc9d8b74e23759e264c35cfe58d3c21f4ee6dcfebcd50ba60d&reaction=dislike'>👎</a>



##########
superset-frontend/packages/superset-ui-core/src/components/Select/AsyncSelect.tsx:
##########
@@ -38,6 +39,8 @@ import {
   getClientErrorObject,
 } from '@superset-ui/core';
 import {
+  BaseOptionType,
+  DefaultOptionType,

Review Comment:
   **Suggestion:** Avoid introducing new direct `antd` type dependencies in 
this UI component; replace these imports with a local/shared type exported by 
the approved Superset wrapper layer so consumers stay decoupled from Ant Design 
internals. [custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   The file directly imports `BaseOptionType` and `DefaultOptionType` from 
`antd/es/select`, which is a direct Ant Design dependency in frontend UI code. 
The rule explicitly flags direct Ant Design imports and prefers using 
`@superset-ui/core` or approved wrappers instead.
   </details>
   
   [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=831e84be3dee4dd9a8b6fdf7aaa2b6c5&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=831e84be3dee4dd9a8b6fdf7aaa2b6c5&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/packages/superset-ui-core/src/components/Select/AsyncSelect.tsx
   **Line:** 42:43
   **Comment:**
        *Custom Rule: Avoid introducing new direct `antd` type dependencies in 
this UI component; replace these imports with a local/shared type exported by 
the approved Superset wrapper layer so consumers stay decoupled from Ant Design 
internals.
   
   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%2F39535&comment_hash=1f1be75729b7bc1b04c1ad5c664b024645b6e701f54205175781ae8bcfaf30d5&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39535&comment_hash=1f1be75729b7bc1b04c1ad5c664b024645b6e701f54205175781ae8bcfaf30d5&reaction=dislike'>👎</a>



##########
superset-frontend/packages/superset-ui-core/src/components/TableCollection/index.tsx:
##########
@@ -27,7 +27,12 @@ import {
 } from 'react-table';
 import { styled } from '@apache-superset/core/theme';
 import { Table, TableSize } from '@superset-ui/core/components/Table';
-import { TableRowSelection, SorterResult } from 'antd/es/table/interface';
+import {
+  ColumnsType,
+  TableRowSelection,
+  SorterResult,
+} from 'antd/es/table/interface';
+import type { TableProps } from 'antd/es/table';

Review Comment:
   **Suggestion:** Remove this direct `antd` type import and source the table 
prop typing from `@superset-ui/core/components/Table` to comply with the 
wrapper-only import rule for frontend UI code. [custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   This is also a direct Ant Design import in frontend UI code, which the 
custom rule forbids. It should come from `@superset-ui/core` or an approved 
wrapper instead.
   </details>
   
   [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=7f3e863862c4447880a895bc3e25b9e9&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=7f3e863862c4447880a895bc3e25b9e9&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/packages/superset-ui-core/src/components/TableCollection/index.tsx
   **Line:** 35:35
   **Comment:**
        *Custom Rule: Remove this direct `antd` type import and source the 
table prop typing from `@superset-ui/core/components/Table` to comply with the 
wrapper-only import rule for frontend UI code.
   
   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%2F39535&comment_hash=f47b18985b0cead7bf133dd8aff475295cb1a22dd5e72d7e4ba394916e97eb9c&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39535&comment_hash=f47b18985b0cead7bf133dd8aff475295cb1a22dd5e72d7e4ba394916e97eb9c&reaction=dislike'>👎</a>



##########
superset-frontend/packages/superset-ui-core/src/components/TableCollection/index.tsx:
##########
@@ -27,7 +27,12 @@ import {
 } from 'react-table';
 import { styled } from '@apache-superset/core/theme';
 import { Table, TableSize } from '@superset-ui/core/components/Table';
-import { TableRowSelection, SorterResult } from 'antd/es/table/interface';
+import {
+  ColumnsType,
+  TableRowSelection,
+  SorterResult,
+} from 'antd/es/table/interface';

Review Comment:
   **Suggestion:** Replace this direct `antd` type import with types 
re-exported from `@superset-ui/core/components/Table` (or type expressions 
derived from that wrapper) so UI code depends on approved Superset wrappers 
instead of Ant Design internals. [custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   This is a direct Ant Design import in frontend UI code. The custom rule 
explicitly flags direct `antd` imports and prefers `@superset-ui/core` wrappers 
or approved exports instead, so the violation is real.
   </details>
   
   [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=fb881edffea3458b9b413322faad40be&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=fb881edffea3458b9b413322faad40be&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/packages/superset-ui-core/src/components/TableCollection/index.tsx
   **Line:** 30:34
   **Comment:**
        *Custom Rule: Replace this direct `antd` type import with types 
re-exported from `@superset-ui/core/components/Table` (or type expressions 
derived from that wrapper) so UI code depends on approved Superset wrappers 
instead of Ant Design internals.
   
   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%2F39535&comment_hash=04ea1d7b1c002162ada1ef73a483458f187d98701022584cb72470c96ecf6082&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39535&comment_hash=04ea1d7b1c002162ada1ef73a483458f187d98701022584cb72470c96ecf6082&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]

Reply via email to