This is an automated email from the ASF dual-hosted git repository.

beto pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new e516bba8fc fix: table autocomplete should pass catalog (#28413)
e516bba8fc is described below

commit e516bba8fcbc6c0c0b6fbe928c1f1a614f519582
Author: Beto Dealmeida <[email protected]>
AuthorDate: Thu May 9 15:57:31 2024 -0400

    fix: table autocomplete should pass catalog (#28413)
---
 .../components/AceEditorWrapper/useKeywords.test.ts       | 15 +++++++++++++--
 .../src/SqlLab/components/AceEditorWrapper/useKeywords.ts |  4 +++-
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git 
a/superset-frontend/src/SqlLab/components/AceEditorWrapper/useKeywords.test.ts 
b/superset-frontend/src/SqlLab/components/AceEditorWrapper/useKeywords.test.ts
index 193e715fb2..350e7ec121 100644
--- 
a/superset-frontend/src/SqlLab/components/AceEditorWrapper/useKeywords.test.ts
+++ 
b/superset-frontend/src/SqlLab/components/AceEditorWrapper/useKeywords.test.ts
@@ -61,6 +61,7 @@ const fakeFunctionNamesApiResult = {
 };
 
 const expectDbId = 1;
+const expectCatalog = null;
 const expectSchema = 'schema1';
 
 beforeEach(() => {
@@ -228,7 +229,12 @@ test('returns column keywords among selected tables', 
async () => {
       ),
     );
     storeWithSqlLab.dispatch(
-      addTable({ id: expectQueryEditorId }, expectTable, expectSchema),
+      addTable(
+        { id: expectQueryEditorId },
+        expectTable,
+        expectCatalog,
+        expectSchema,
+      ),
     );
   });
 
@@ -267,7 +273,12 @@ test('returns column keywords among selected tables', 
async () => {
 
   act(() => {
     storeWithSqlLab.dispatch(
-      addTable({ id: expectQueryEditorId }, unexpectedTable, expectSchema),
+      addTable(
+        { id: expectQueryEditorId },
+        unexpectedTable,
+        expectCatalog,
+        expectSchema,
+      ),
     );
   });
 
diff --git 
a/superset-frontend/src/SqlLab/components/AceEditorWrapper/useKeywords.ts 
b/superset-frontend/src/SqlLab/components/AceEditorWrapper/useKeywords.ts
index 2eac21ff39..df45290f6c 100644
--- a/superset-frontend/src/SqlLab/components/AceEditorWrapper/useKeywords.ts
+++ b/superset-frontend/src/SqlLab/components/AceEditorWrapper/useKeywords.ts
@@ -146,7 +146,9 @@ export function useKeywords(
 
   const insertMatch = useEffectEvent((editor: Editor, data: any) => {
     if (data.meta === 'table') {
-      dispatch(addTable({ id: queryEditorId, dbId }, data.value, schema));
+      dispatch(
+        addTable({ id: queryEditorId, dbId }, data.value, catalog, schema),
+      );
     }
 
     let { caption } = data;

Reply via email to