From 555d26b2649ae784ea592b970ca45b19b8567e93 Mon Sep 17 00:00:00 2001 From: "Hugh A. Miles II" Date: Fri, 15 Jul 2022 00:36:39 +0000 Subject: [PATCH] address comments v2 --- RELEASING/release-notes-2-0/changelog.md | 16 ++++++++++++++++ .../src/SqlLab/components/ResultSet/index.tsx | 4 ++-- .../SqlLab/components/SaveDatasetModal/index.tsx | 8 ++++---- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/RELEASING/release-notes-2-0/changelog.md b/RELEASING/release-notes-2-0/changelog.md index 91efed7dba822..e12079c524439 100644 --- a/RELEASING/release-notes-2-0/changelog.md +++ b/RELEASING/release-notes-2-0/changelog.md @@ -1,3 +1,19 @@ + ### 2.0 (Thu Jun 23 05:39:46 2022 -0600) **Database Migrations** - [#20385](https://github.com/apache/superset/pull/20385) fix(migration): Ensure key_value LargeBinary is encoded as a MEDIUMBLOB as opposed to BLOB for MySQL (@john-bodley) diff --git a/superset-frontend/src/SqlLab/components/ResultSet/index.tsx b/superset-frontend/src/SqlLab/components/ResultSet/index.tsx index 32dd7d4d83578..c236b86e5d08f 100644 --- a/superset-frontend/src/SqlLab/components/ResultSet/index.tsx +++ b/superset-frontend/src/SqlLab/components/ResultSet/index.tsx @@ -224,7 +224,7 @@ export default class ResultSet extends React.PureComponent< const { showSaveDatasetModal } = this.state; const { query } = this.props; - const dataset: ISaveableDatasource = { + const datasource: ISaveableDatasource = { columns: query.columns as ISimpleColumn[], name: query?.tab || 'Untitled', dbId: 1, @@ -243,7 +243,7 @@ export default class ResultSet extends React.PureComponent< modalDescription={t( 'Save this query as a virtual dataset to continue exploring', )} - datasource={dataset} + datasource={datasource} /> {this.props.visualize && diff --git a/superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx b/superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx index 1d737927dd660..6bf4276bb6dc2 100644 --- a/superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx +++ b/superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx @@ -172,9 +172,9 @@ export const SaveDatasetModal: FunctionComponent = ({ const handleOverwriteDataset = async () => { const [, key] = await Promise.all([ updateDataset( - datasource.dbId, - datasetToOverwrite.datasetid, - datasource.sql, + datasource?.dbId, + datasetToOverwrite?.datasetid, + datasource?.sql, datasource?.columns?.map( (d: { name: string; type: string; is_dttm: boolean }) => ({ column_name: d.name, @@ -182,7 +182,7 @@ export const SaveDatasetModal: FunctionComponent = ({ is_dttm: d.is_dttm, }), ), - datasetToOverwrite.owners?.map((o: DatasetOwner) => o.id), + datasetToOverwrite?.owners?.map((o: DatasetOwner) => o.id), true, ), postFormData(datasetToOverwrite.datasetid, 'table', {