codeant-ai-for-open-source[bot] commented on code in PR #37298: URL: https://github.com/apache/superset/pull/37298#discussion_r2743827091
########## superset-frontend/src/SqlLab/components/TableExploreTree/index.tsx: ########## @@ -0,0 +1,335 @@ +/** + * 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 { + useCallback, + useState, + useRef, + type ChangeEvent, + useMemo, +} from 'react'; +import { useSelector, useDispatch, shallowEqual } from 'react-redux'; +import { styled, t } from '@apache-superset/core'; +import AutoSizer from 'react-virtualized-auto-sizer'; +// Due to performance issues with the virtual list in the existing Ant Design (antd)-based tree view, +// it has been replaced with react-arborist solution. +import { Tree, TreeApi, NodeApi } from 'react-arborist'; +import { + Icons, + Skeleton, + Input, + Empty, + Button, +} from '@superset-ui/core/components'; +import type { SqlLabRootState } from 'src/SqlLab/types'; +import useQueryEditor from 'src/SqlLab/hooks/useQueryEditor'; +import { addTable } from 'src/SqlLab/actions/sqlLab'; +import PanelToolbar from 'src/components/PanelToolbar'; +import { ViewContribution } from 'src/SqlLab/contributions'; +import TreeNodeRenderer from './TreeNodeRenderer'; +import useTreeData, { EMPTY_NODE_ID_PREFIX } from './useTreeData'; +import type { TreeNodeData } from './types'; +import { ErrorMessageWithStackTrace } from 'src/components'; Review Comment: **Suggestion:** Import path may be too generic — importing `ErrorMessageWithStackTrace` from the barrel `src/components` can break if that symbol is not exported from the barrel; import the component from its explicit module to ensure the symbol exists at compile/runtime. [possible bug] <details> <summary><b>Severity Level:</b> Major ⚠️</summary> ```mdx - ❌ Build/CI may fail on missing barrel export. - ⚠️ SQLLab left sidebar error UI absent. - ⚠️ CI build failures block deployments. ``` </details> ```suggestion import { ErrorMessageWithStackTrace } from 'src/components/ErrorMessageWithStackTrace'; ``` <details> <summary><b>Steps of Reproduction ✅ </b></summary> ```mdx 1. Open file superset-frontend/src/SqlLab/components/TableExploreTree/index.tsx and locate the import at line 47: `import { ErrorMessageWithStackTrace } from 'src/components';`. 2. Run the TypeScript build (project root) via the repository's build command (e.g. `npm run build` / `yarn build`) so the TypeScript compiler resolves barrel exports. 3. If `src/components` (the barrel, e.g. src/components/index.ts) does not re-export ErrorMessageWithStackTrace, the TypeScript compiler will raise an error like `TS2305: Module '"src/components"' has no exported member 'ErrorMessageWithStackTrace'` (compile failure referencing index.tsx:47). 4. If the project is built without type checks (or at runtime), React will attempt to render TableExploreTree; the usage site at lines 272-274 (`{errorPayload && (<ErrorMessageWithStackTrace ... />)}`) will attempt to render an undefined value and can produce runtime errors or missing error UI in SQLLab left sidebar. ``` </details> <details> <summary><b>Prompt for AI Agent 🤖 </b></summary> ```mdx This is a comment left during a code review. **Path:** superset-frontend/src/SqlLab/components/TableExploreTree/index.tsx **Line:** 47:47 **Comment:** *Possible Bug: Import path may be too generic — importing `ErrorMessageWithStackTrace` from the barrel `src/components` can break if that symbol is not exported from the barrel; import the component from its explicit module to ensure the symbol exists at compile/runtime. 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. ``` </details> -- 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]
