bito-code-review[bot] commented on PR #42620:
URL: https://github.com/apache/superset/pull/42620#issuecomment-5135794042

   <!-- Bito Reply -->
   The pull request addresses this issue by changing how dataset options are 
keyed and filtered in the `SaveDatasetModal`. Previously, options were keyed by 
`table_name`, which caused collisions when multiple datasets shared the same 
name. The changes update the `value` to use the unique `id` and update the 
`label` to include the schema (e.g., `schema.table_name`). Additionally, the 
`filterAutocompleteOption` function was updated to filter based on the `label` 
(which now includes the schema) rather than the `value` (the ID), ensuring that 
typing a schema prefix correctly narrows the list to the intended dataset.
   
   **superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx**
   ```
   // `id` is unique; `table_name` is not. Keying options by the table
             // name collapses same-named datasets onto a single Select key, 
which
             // renders duplicate rows and makes the overwrite target ambiguous.
             value: r.id,
             label: r.schema ? `${r.schema}.${r.table_name}` : r.table_name,
   ```
   
   **superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx**
   ```
   const filterAutocompleteOption = (
       inputValue: string,
       option: DatasetOverwriteOption,
     ) => option.label.toLowerCase().includes(inputValue.toLowerCase());
   ```


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