GitHub user dosubot[bot] added a comment to the discussion: Version 5.0.0: 
Jinja Templates are unavailable

<!-- Greeting -->
Hi @2873377152! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the 
superset team.

<!-- Answer -->
Jinja template processing in Superset 5.0.0 is controlled by the 
`ENABLE_TEMPLATE_PROCESSING` feature flag, which is set to `False` by default 
and must be explicitly enabled in your configuration (usually in 
`superset_config.py`). When enabled, SQL Lab queries should be processed by the 
Jinja engine, rendering functions like `{{ current_username() }}` to the actual 
username, regardless of the database backend—including Postgres and MySQL. 
There is no code or documentation indicating that Jinja processing is 
intentionally disabled for the metadata database or specific engines in SQL Lab 
for this version 
([source](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/jinja_context.py),
 
[source](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/config.py)).

If you see literal template strings in your results, the most likely causes are:

- The feature flag is not set or not loaded correctly at runtime (e.g., 
`superset_config.py` is not being picked up, or the flag is set in the wrong 
place).
- There is an environment/context initialization issue (such as multiple 
Superset processes, config file placement, or containerization problems).
- There is a regression or bug not yet tracked in the issue tracker.

**Troubleshooting steps:**
1. Double-check that `ENABLE_TEMPLATE_PROCESSING` is set to `True` in your 
`superset_config.py` and that this config file is being loaded by your Superset 
instance.
2. Restart all Superset processes after changing the config to ensure the flag 
is picked up.
3. Check the logs for any warnings or errors related to template processing or 
config loading.
4. If you are running Superset in containers, make sure the config file is 
mounted and available in all containers.
5. Try running a query with a simple Jinja template and see if it renders when 
you provide template parameters (e.g., `SELECT '{{ state }}'` with `{"state": 
"CA"}` as template params).

Integration tests for Superset 5.0.0 confirm that Jinja template processing 
works in SQL Lab when the flag is enabled 
([source](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/tests/integration_tests/sqllab_tests.py)),
 so if it’s not working for you, it’s likely a configuration or environment 
issue rather than an intentional limitation or known bug.


<!-- 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/15278759-df27-4120-848c-4e6bc0ecd96c?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/15278759-df27-4120-848c-4e6bc0ecd96c?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/15278759-df27-4120-848c-4e6bc0ecd96c?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/15278759-df27-4120-848c-4e6bc0ecd96c?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/15278759-df27-4120-848c-4e6bc0ecd96c?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/15278759-df27-4120-848c-4e6bc0ecd96c?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/15278759-df27-4120-848c-4e6bc0ecd96c?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat
 with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&
 nbsp;[![Join 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![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/35025)

GitHub link: 
https://github.com/apache/superset/discussions/36147#discussioncomment-14995107

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to