diff --git a/superset-frontend/src/datasource/DatasourceModal.tsx b/superset-frontend/src/datasource/DatasourceModal.tsx index 678ef8a725cec..5c2a184755a8e 100644 --- a/superset-frontend/src/datasource/DatasourceModal.tsx +++ b/superset-frontend/src/datasource/DatasourceModal.tsx @@ -83,15 +83,16 @@ const DatasourceModal: FunctionComponent = ({ const onConfirmSave = () => { // Pull out extra fields into the extra object - + const schema = + currentDatasource.schema || + currentDatasource.databaseSelector?.schema || + currentDatasource.tableSelector?.schema; SupersetClient.post({ endpoint: '/datasource/save/', postPayload: { data: { ...currentDatasource, - schema: - currentDatasource.databaseSelector?.schema || - currentDatasource.tableSelector?.schema, + schema, metrics: currentDatasource?.metrics?.map( (metric: Record) => ({ ...metric,