Description
Bug description
Queries which contain Jinja templating {{ dataset(id) }}
are saved successfully and are shown in the saved queries list. But after deleting one of the used dataset as a result we see no saved queries in the list and error An error occurred while fetching Saved queriess: Dataset ID not found
.
Therefore users can't delete the saved query with the deleted dataset to display the list of other saved queries.
How to reproduce the bug
-
Add a dataset
-
Create a saved query which contain a SQL statement with Jinja templating {{ dataset(id) }} (the ID of the dataset created in step 1), i.e.
SELECT * FROM {{ dataset(id) }}
-
Go to
/savedqueryview/list/
to make sure that the query is listed -
Delete the dataset created in step 1
-
Go to
/superset/welcome/
to see the errorThere was an issue fetching your saved queries: [object Response]
-
Go to
/savedqueryview/list/
to see the errorAn error occurred while fetching Saved queriess: Dataset ID not found!
and the empty list of saved queries
Screenshots/recordings
No response
Superset version
4.1.1
Python version
3.9
Node version
I don't know
Browser
Chrome
Additional context
No response
Checklist
- I have searched Superset docs and Slack and didn't find a solution to my problem.
- I have searched the GitHub issue tracker and didn't find a similar bug report.
- 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.