From 87d47987b7800a183f3eebf2cfa7781d450e6e37 Mon Sep 17 00:00:00 2001 From: Ville Brofeldt <33317356+villebro@users.noreply.github.com> Date: Tue, 12 Apr 2022 15:13:03 +0300 Subject: [PATCH] fix(sql-lab): do not replace undefined schema with empty object (#19664) --- superset-frontend/src/SqlLab/actions/sqlLab.js | 2 +- superset-frontend/src/SqlLab/types.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/superset-frontend/src/SqlLab/actions/sqlLab.js b/superset-frontend/src/SqlLab/actions/sqlLab.js index e602b796bd..3d1298e6c3 100644 --- a/superset-frontend/src/SqlLab/actions/sqlLab.js +++ b/superset-frontend/src/SqlLab/actions/sqlLab.js @@ -791,7 +791,7 @@ export function queryEditorSetSchema(queryEditor, schema) { dispatch({ type: QUERY_EDITOR_SET_SCHEMA, queryEditor: queryEditor || {}, - schema: schema || {}, + schema, }), ) .catch(() => diff --git a/superset-frontend/src/SqlLab/types.ts b/superset-frontend/src/SqlLab/types.ts index d5dfddbe2b..6693089574 100644 --- a/superset-frontend/src/SqlLab/types.ts +++ b/superset-frontend/src/SqlLab/types.ts @@ -61,7 +61,7 @@ export type Query = { query: { limit: number }; }; resultsKey: string | null; - schema: string; + schema?: string; sql: string; sqlEditorId: string; state: QueryState;