codeant-ai-for-open-source[bot] commented on code in PR #43277: URL: https://github.com/apache/superset/pull/43277#discussion_r3800351883
########## superset-frontend/src/dashboard/components/gridComponents/FilterHolder/FilterHolder.test.tsx: ########## @@ -0,0 +1,144 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import { render, screen } from 'spec/helpers/testing-library'; +import newComponentFactory from 'src/dashboard/util/newComponentFactory'; +import { FILTER_TYPE, ROW_TYPE } from 'src/dashboard/util/componentTypes'; +import FilterHolder from './FilterHolder'; + +jest.mock( + 'src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterControl', + () => + ({ filter }: { filter: { name?: string; id: string } }) => ( + <div data-test="mock-filter-control">{filter.name || filter.id}</div> + ), Review Comment: **Suggestion:** The mock exposes `data-test`, but `getByTestId` searches for `data-testid`, so the bound-filter test will fail even when `FilterControl` renders correctly. Use the attribute expected by the testing-library helper or assert using the existing attribute. [possible bug] <details> <summary><b>Severity Level:</b> Major ⚠️</summary> ```mdx - ❌ Bound FilterHolder test fails during frontend test runs. - ⚠️ Canvas filter regression coverage cannot pass as written. ``` </details> [](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=9d76c4a2fff8476c96274aec520320e1&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=9d76c4a2fff8476c96274aec520320e1&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) <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/gridComponents/FilterHolder/FilterHolder.test.tsx **Line:** 27:29 **Comment:** *Possible Bug: The mock exposes `data-test`, but `getByTestId` searches for `data-testid`, so the bound-filter test will fail even when `FilterControl` renders correctly. Use the attribute expected by the testing-library helper or assert using the existing attribute. 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%2F43277&comment_hash=200d6a635870ab3777084b0b26bc93fe74c3116e1c6dfd8c1fa1f295b94141ee&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43277&comment_hash=200d6a635870ab3777084b0b26bc93fe74c3116e1c6dfd8c1fa1f295b94141ee&reaction=dislike'>👎</a> ########## superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx: ########## @@ -215,6 +226,11 @@ const FilterBar: FC<FiltersBarProps> = ({ () => new Set(filtersInScope.map(f => f.id)), [filtersInScope], ); + const [allFiltersInScope] = useSelectFiltersInScope(allNativeFilterValues); + const allInScopeFilterIds = useMemo( + () => new Set(allFiltersInScope.map(f => f.id)), + [allFiltersInScope], Review Comment: **Suggestion:** The newly computed `allInScopeFilterIds` is never consumed. The required-filter and clear/apply paths below still operate on `nativeFilterValues` and `inScopeFilterIds`, which intentionally exclude canvas-bound filters, so canvas filters are not incorporated into the intended all-filter scope behavior. Propagate the all-filter scope set to the relevant checks or remove this unused computation. [incomplete implementation] <details> <summary><b>Severity Level:</b> Major ⚠️</summary> ```mdx - ❌ Frontend type-check can fail on unused scope computation. - ⚠️ Shared apply and clear paths exclude canvas filters. ``` </details> [](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=ae12b63ca3514fb49a2caea925f72c4e&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=ae12b63ca3514fb49a2caea925f72c4e&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) <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/FilterBar/index.tsx **Line:** 229:232 **Comment:** *Incomplete Implementation: The newly computed `allInScopeFilterIds` is never consumed. The required-filter and clear/apply paths below still operate on `nativeFilterValues` and `inScopeFilterIds`, which intentionally exclude canvas-bound filters, so canvas filters are not incorporated into the intended all-filter scope behavior. Propagate the all-filter scope set to the relevant checks or remove this unused computation. 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%2F43277&comment_hash=15a9f79337bd0c3a838ba6f8f75bc88222f2f538ce8cf24a33d7ad8eb63c9dbe&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43277&comment_hash=15a9f79337bd0c3a838ba6f8f75bc88222f2f538ce8cf24a33d7ad8eb63c9dbe&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]
