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

beto pushed a commit to branch query-cost-estimation-catalog
in repository https://gitbox.apache.org/repos/asf/superset.git

commit fef57e7a1e590e6b4d0c3bd45aa850159f1b920e
Author: Beto Dealmeida <[email protected]>
AuthorDate: Thu May 9 12:15:10 2024 -0400

    fix: pass catalog when estimating query cost
---
 superset-frontend/src/SqlLab/actions/sqlLab.js | 3 ++-
 superset/sqllab/schemas.py                     | 3 +++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/superset-frontend/src/SqlLab/actions/sqlLab.js 
b/superset-frontend/src/SqlLab/actions/sqlLab.js
index a153c4eb45..7a73f9b9c8 100644
--- a/superset-frontend/src/SqlLab/actions/sqlLab.js
+++ b/superset-frontend/src/SqlLab/actions/sqlLab.js
@@ -191,12 +191,13 @@ export function scheduleQuery(query) {
 
 export function estimateQueryCost(queryEditor) {
   return (dispatch, getState) => {
-    const { dbId, schema, sql, selectedText, templateParams } =
+    const { dbId, catalog, schema, sql, selectedText, templateParams } =
       getUpToDateQuery(getState(), queryEditor);
     const requestSql = selectedText || sql;
 
     const postPayload = {
       database_id: dbId,
+      catalog,
       schema,
       sql: requestSql,
       template_params: JSON.parse(templateParams || '{}'),
diff --git a/superset/sqllab/schemas.py b/superset/sqllab/schemas.py
index 5e22a97e2a..f441cdf047 100644
--- a/superset/sqllab/schemas.py
+++ b/superset/sqllab/schemas.py
@@ -37,6 +37,9 @@ class EstimateQueryCostSchema(Schema):
     template_params = fields.Dict(
         keys=fields.String(), metadata={"description": "The SQL query template 
params"}
     )
+    catalog = fields.String(
+        allow_none=True, metadata={"description": "The database catalog"}
+    )
     schema = fields.String(
         allow_none=True, metadata={"description": "The database schema"}
     )

Reply via email to