diff --git a/superset-frontend/src/datasource/DatasourceEditor.jsx b/superset-frontend/src/datasource/DatasourceEditor.jsx index e80e402ec07a4..81509715aed1b 100644 --- a/superset-frontend/src/datasource/DatasourceEditor.jsx +++ b/superset-frontend/src/datasource/DatasourceEditor.jsx @@ -471,7 +471,6 @@ class DatasourceEditor extends React.PureComponent { const { datasourceType, datasource } = this.state; const sql = datasourceType === DATASOURCE_TYPES.physical.key ? '' : datasource.sql; - const newDatasource = { ...this.state.datasource, sql, @@ -489,6 +488,7 @@ class DatasourceEditor extends React.PureComponent { } onDatasourcePropChange(attr, value) { + if (value === undefined) return; // if value is undefined do not update state const datasource = { ...this.state.datasource, [attr]: value }; this.setState( prevState => ({