Non-descriptive error when saving Dataset from SQL Lab with JINJA placeholder present
Bug description
I get a "FATAL ERROR" when I try to save a dataset from SQL Lab that looks like this:
SELECT COL_ID as ID, COL_DESCRIPTION as DESCRIPTION, COL_CREATEDDATE as CREATEDDATE, COL_TAG as TAG, COL_VIEWCOUNT as VIEWCOUNT FROM {{ecx_schema}}.tbl_kbtag
But I don't get an error if I save it like this:
SELECT COL_ID as ID, COL_DESCRIPTION as DESCRIPTION, COL_CREATEDDATE as CREATEDDATE, COL_TAG as TAG, COL_VIEWCOUNT as VIEWCOUNT FROM my_schema.tbl_kbtag
While it would be good to be able to save these datasets and pre-populate the jinja params in the new dataset, simply explaining the error instead of "Fatal Error" would be a good start.
How to reproduce the bug
- Go to SQL Lab
- Create an SQL query with the schema name in a Jinja template
- Click Save Dataset
Screenshots/recordings
Superset version
3.0.3
Python version
3.9
Node version
16
Browser
Chrome
Additional context
No response
Checklist
- [X] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [X] I have searched the GitHub issue tracker and didn't find a similar bug report.
- [X] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
relevant discussion #25786
Adding a link the relevant PR that would likely close this (I think?)
https://github.com/apache/superset/pull/27796
The issue appears when you try to use jinja templating and save the query in SQLLab as a dataset. If you save the dataset and provide a default value in place of using any jinja templates.Then during the chart development process, you can make updates to the query and enter your jinja template. This won't lead to errors.
Closing as a duplicate of https://github.com/apache/superset/issues/25786... let's take the conversation (and hopefully a solution!) there.