rusackas commented on code in PR #36760:
URL: https://github.com/apache/superset/pull/36760#discussion_r2665525798


##########
superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx:
##########
@@ -195,7 +195,8 @@ const SqlEditorLeftBar = ({ queryEditorId }: 
SqlEditorLeftBarProps) => {
 
   const handleDbList = useCallback(
     (result: DatabaseObject) => {
-      dispatch(setDatabases(result));
+      // eslint-disable-next-line @typescript-eslint/no-explicit-any

Review Comment:
   This is not a bug.
   
     Looking at the reducer (lines 707-718):
     [actions.SET_DATABASES]() {
       const databases: any = {};
       (action.databases as any[])!.forEach((db: any) => {
         databases[db.id] = {  // <-- Converts array to map
           ...db,
           extra_json: JSON.parse(db.extra || ''),
         };
       });
       return { ...state, databases };  // Stores as map
     }
   
     The flow is:
     1. Input: setDatabases receives an array from the API
     2. Reducer: Converts array → map keyed by db.id
     3. State: Stores databases as a map
     4. Usage: databases[dbId] lookups work correctly
   
     The action accepts an array, and the reducer transforms it to a map 
internally. This is by design - no fix needed.



-- 
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