codeant-ai-for-open-source[bot] commented on code in PR #40003:
URL: https://github.com/apache/superset/pull/40003#discussion_r3465700638
##########
superset-frontend/src/dashboard/components/nativeFilters/selectors.test.ts:
##########
@@ -565,3 +582,47 @@ test('getAppliedColumnsWithFallback prioritizes query
response over fallback', (
);
expect(result).toEqual(new Set(['query_column']));
});
+
+test('selectNativeIndicatorsForChart marks rejected filters from later query
responses incompatible', () => {
+ const chartId = 987;
+ const nativeFilters = {
+ filter1: {
+ id: 'filter1',
+ name: 'Age',
+ type: NativeFilterType.NativeFilter,
+ chartsInScope: [chartId],
+ targets: [{ column: { name: 'age' } }],
+ },
+ } as any;
+ const dataMask = {
Review Comment:
**Suggestion:** Replace this `as any` cast with `DataMaskStateWithId` (or an
appropriate narrowed typed shape) to avoid bypassing TypeScript checks in the
test. [custom_rule]
**Severity Level:** Minor ⚠️
<details>
<summary><b>Why it matters? 🤔 </b></summary>
The final file also contains another `as any` cast in the same modified
TypeScript test file. Because the rule forbids `any` in new or modified TS/TSX
code, this suggestion is valid.
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=23b2c406b4af44f98245ad5ea450e52b&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=23b2c406b4af44f98245ad5ea450e52b&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/src/dashboard/components/nativeFilters/selectors.test.ts
**Line:** 597:597
**Comment:**
*Custom Rule: Replace this `as any` cast with `DataMaskStateWithId` (or
an appropriate narrowed typed shape) to avoid bypassing TypeScript checks in
the test.
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%2F40003&comment_hash=4b717f97355034b08f8009a8b24fbdfa83e25094a14932e4097bdbbded2a00ba&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F40003&comment_hash=4b717f97355034b08f8009a8b24fbdfa83e25094a14932e4097bdbbded2a00ba&reaction=dislike'>👎</a>
##########
superset-frontend/src/dashboard/components/nativeFilters/selectors.ts:
##########
@@ -191,7 +201,7 @@ export const getAppliedColumnsWithFallback = (
const getRejectedColumns = (chart: any): Set<string> =>
new Set(
- (chart?.queriesResponse?.[0]?.rejected_filters || []).map((filter: any) =>
+ getQueryFilterMetadata(chart, 'rejected_filters').map((filter: any) =>
getColumnLabel(filter.column),
Review Comment:
**Suggestion:** Replace the inline `any` type for mapped filter entries with
a typed filter metadata interface (or inferred generic) that explicitly defines
the `column` field. [custom_rule]
**Severity Level:** Minor ⚠️
<details>
<summary><b>Why it matters? 🤔 </b></summary>
The final code maps over filter metadata using `(filter: any)`, which is an
explicit
`any` annotation in modified TypeScript. This directly violates the custom
rule against
using `any` in new or changed TS/TSX code.
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=235e7e242f05404985baeb07db4223a9&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=235e7e242f05404985baeb07db4223a9&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/src/dashboard/components/nativeFilters/selectors.ts
**Line:** 202:205
**Comment:**
*Custom Rule: Replace the inline `any` type for mapped filter entries
with a typed filter metadata interface (or inferred generic) that explicitly
defines the `column` field.
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%2F40003&comment_hash=5916c5f0f6237ae9079712a0f6e5ff722055d2de3ae3a29add13421a092baca2&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F40003&comment_hash=5916c5f0f6237ae9079712a0f6e5ff722055d2de3ae3a29add13421a092baca2&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]