From 4a8acb04e151681af0c2940e6a11c8c2070164ed Mon Sep 17 00:00:00 2001 From: Lily Kuang Date: Thu, 22 Oct 2020 21:59:04 -0700 Subject: [PATCH] fix dataset editor for saving schema (#11396) --- superset-frontend/src/datasource/DatasourceModal.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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,