sadpandajoe commented on code in PR #42620:
URL: https://github.com/apache/superset/pull/42620#discussion_r3686709336


##########
superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx:
##########
@@ -342,9 +371,17 @@ export const SaveDatasetModal = ({
       endpoint: `/api/v1/dataset/?q=${queryParams}`,
     }).then(response => ({
       data: response.json.result.map(
-        (r: { table_name: string; id: number; editors: Subject[] }) => ({
-          value: r.table_name,
-          label: r.table_name,
+        (r: {
+          table_name: string;
+          id: number;
+          editors: Subject[];
+          schema?: string;
+        }) => ({
+          // `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,

Review Comment:
   Datasets are unique by database/catalog/schema/table, so editable datasets 
from different databases or catalogs can still render the same label here and 
leave the user unable to tell which one will be overwritten. Could the label 
and autocomplete search include the database/catalog identity as well?



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