dosubot[bot] commented on issue #34105: URL: https://github.com/apache/superset/issues/34105#issuecomment-3049245394
<!-- Answer --> You can use Jinja parameters in SQL Lab because they're injected at query execution time, but saving a query as a dataset with Jinja parameters requires a few extra things: the ENABLE_TEMPLATE_PROCESSING flag must be enabled, and you must check the "Include Template Parameters" box in the Save Dataset dialog. If you don't see this checkbox, it could be a frontend cache/config issue—try a hard refresh or restarting Superset to ensure the flag is recognized in the UI. If you do see the checkbox and still get an error, the most common causes are malformed template parameters (invalid JSON), or issues with how Superset handles Jinja context during dataset validation and permission checks (especially if your SQL can render to an empty or invalid statement) [source](https://github.com/apache/superset/issues/33591). Could you confirm if the checkbox appears for you, and if so, whether you checked it when saving? Also, if you can share the exact error message or stack trace from the UI or logs, that would help pinpoint the issue. In the meantime, double-check that your template parameters are valid JSON, and consider using if/else logic in your SQL to avoid empty results when filters are missing [source](https://github.com/apache/superset/issues/33591). <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/72f19913-993f-46d9-898c-25c9ef392252?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/72f19913-993f-46d9-898c-25c9ef392252?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/72f19913-993f-46d9-898c-25c9ef392252?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/72f19913-993f-46d9-898c-25c9ef392252?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/72f19913-993f-46d9-898c-25c9ef392252?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/72f19913-993f-46d9-898c-25c9ef392252?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/72f19913-993f-46d9-898c-25c9ef392252?feedback_type=other)</sup> [](https://go.dosu.dev/discord-bot) [! [Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/34105) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
