diff --git a/superset-frontend/src/SqlLab/actions/sqlLab.js b/superset-frontend/src/SqlLab/actions/sqlLab.js
index 3b48c536f7b..c9a7982c9b4 100644
--- a/superset-frontend/src/SqlLab/actions/sqlLab.js
+++ b/superset-frontend/src/SqlLab/actions/sqlLab.js
@@ -1245,6 +1245,7 @@ export function popSavedQuery(saveQueryId) {
};
const tmpAdaptedProps = {
name: queryEditorProps.name,
+ description: queryEditorProps.description,
dbId: queryEditorProps.database.id,
catalog: queryEditorProps.catalog,
schema: queryEditorProps.schema,
diff --git a/superset-frontend/src/SqlLab/actions/sqlLab.test.js b/superset-frontend/src/SqlLab/actions/sqlLab.test.js
index a3327023c70..412116c17c1 100644
--- a/superset-frontend/src/SqlLab/actions/sqlLab.test.js
+++ b/superset-frontend/src/SqlLab/actions/sqlLab.test.js
@@ -670,7 +670,7 @@ describe('async actions', () => {
database_name: 'examples',
id: 2,
},
- description: '',
+ description: 'A saved query description',
id: 1,
label: 'Query 1',
schema: 'public',
@@ -720,6 +720,7 @@ describe('async actions', () => {
const expectedParams = {
name: 'Query 1',
+ description: 'A saved query description',
dbId: 2,
catalog: null,
schema: 'public',
diff --git a/superset-frontend/src/SqlLab/components/SaveQuery/SaveQuery.test.tsx b/superset-frontend/src/SqlLab/components/SaveQuery/SaveQuery.test.tsx
index f375b4cb4ad..56dea15f4d1 100644
--- a/superset-frontend/src/SqlLab/components/SaveQuery/SaveQuery.test.tsx
+++ b/superset-frontend/src/SqlLab/components/SaveQuery/SaveQuery.test.tsx
@@ -171,6 +171,47 @@ describe('SavedQuery', () => {
expect(updateBtn).toBeInTheDocument();
});
+ test('pre-fills the description from an existing saved query and updates with it unchanged', async () => {
+ const storedDescription = 'This is the stored description';
+ const mockOnUpdate = jest.fn();
+
+ render(