sadpandajoe commented on code in PR #42620:
URL: https://github.com/apache/superset/pull/42620#discussion_r3708287658
##########
superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx:
##########
@@ -195,6 +195,37 @@ const updateDataset = async ({
const UNTITLED = t('Untitled Dataset');
+/**
+ * Datasets are unique by database, catalog, schema and table name, so a label
+ * built from anything less can be ambiguous — e.g. `examples.public.sales`.
+ */
+const qualifiedLabel = (dataset: {
+ database?: { database_name?: string };
+ catalog?: string | null;
+ schema?: string | null;
+ table_name: string;
+}) =>
+ [
+ dataset.database?.database_name,
+ dataset.catalog,
+ dataset.schema,
+ dataset.table_name,
+ ]
+ .filter(Boolean)
Review Comment:
Dropping empty qualifier slots makes distinct datasets such as
`(catalog=reporting, schema=null)` and `(catalog=null, schema=reporting)`
render the same label, so the overwrite picker cannot tell users which dataset
they are selecting. Could this preserve the qualifier positions or label each
component explicitly?
--
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]