michael-s-molina commented on code in PR #24599:
URL: https://github.com/apache/superset/pull/24599#discussion_r1268131641
##########
superset-frontend/src/features/datasets/AddDataset/LeftPanel/index.tsx:
##########
@@ -239,140 +156,39 @@ export default function LeftPanel({
}
}, [setDatabase]);
- useEffect(() => {
- if (loadTables) {
- const params = rison.encode({
- force: refresh,
- schema_name: encodedSchema,
- });
-
- const endpoint =
`/api/v1/database/${dataset?.db?.id}/tables/?q=${params}`;
- getTablesList(endpoint);
- }
- }, [loadTables, dataset?.db?.id, encodedSchema, getTablesList, refresh]);
-
- useEffect(() => {
- if (resetTables) {
- setTableOptions([]);
- setResetTables(false);
- }
- }, [resetTables]);
-
- const filteredOptions = tableOptions.filter(option =>
- option?.value?.toLowerCase().includes(searchVal.toLowerCase()),
- );
-
- const Loader = (inline: string) => (
- <div className="loading-container">
- <Loading position="inline" />
- <p>{inline}</p>
- </div>
+ const datasetNamesSet = datasetNames?.join(divider);
Review Comment:
Why not using lodash `isEqual` to compare the sets? `split` and `includes`
for every table seems way more expensive.
--
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]