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/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 71ac788  Fix error when templateParams is undefined (#8581)
71ac788 is described below

commit 71ac788b20090a2392f6b42ebfc066f3efc154b6
Author: Beto Dealmeida <[email protected]>
AuthorDate: Thu Nov 14 20:22:06 2019 -0800

    Fix error when templateParams is undefined (#8581)
---
 superset/assets/src/SqlLab/actions/sqlLab.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/superset/assets/src/SqlLab/actions/sqlLab.js 
b/superset/assets/src/SqlLab/actions/sqlLab.js
index b1d8c7d..36df2f4 100644
--- a/superset/assets/src/SqlLab/actions/sqlLab.js
+++ b/superset/assets/src/SqlLab/actions/sqlLab.js
@@ -186,7 +186,7 @@ export function estimateQueryCost(query) {
     dispatch({ type: COST_ESTIMATE_STARTED, query }),
     SupersetClient.post({
       endpoint,
-      postPayload: { sql, templateParams: JSON.parse(templateParams) },
+      postPayload: { sql, templateParams: JSON.parse(templateParams || '{}') },
     })
       .then(({ json }) => dispatch({ type: COST_ESTIMATE_RETURNED, query, json 
}))
       .catch(response =>

Reply via email to