-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Open
Labels
#bugBug reportBug report
Description
Description: Jinja Template {{from_dttm}} and {{to_dttm}} variables not working in SQL queries.
How to reproduce the bug
- Go to 'SQL Lab'
- Write a query containing either the {{from_dttm}} or {{to_dttm}} variables
- Run the query
- See the error
Expected results
The results filtered by the date - From A TO B
Actual results
Parameter error
Failed to execute query '1314' - 'SELECT *
FROM lorem_ipsum.Dim_Lorem_Ipsum
WHERE (
{% if from_dttm is not none %}
dttm_col > {{ from_dttm }} AND
{% endif %}
{% if to_dttm is not none %}
dttm_col < {{ to_dttm }} AND
{% endif %}
true
)': The following parameters in your query are undefined: "from_dttm", "to_dttm".
Please check your template parameters for syntax errors and make sure they match across your SQL query and Set Parameters. Then, try running your query again.
Screenshots
Superset Jinja Variables Issue
Environment
(please complete the following information):
- browser type and version: Microsoft Edge (beta) Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36 Edg/105.0.1343.27
- superset version: latest-dev
- python version: running on k8s, defined by the Helm charts
- node.js version: N/A
- any feature flags active: ALERT_REPORTS, ENABLE_TEMPLATE_PROCESSING, DYNAMIC_PLUGINS
Checklist
Make sure to follow these steps before submitting your issue - thank you!
- I have checked the superset logs for python stacktraces and included it here as text if there are any.
- I have reproduced the issue with at least the latest released version of superset.
- I have checked the issue tracker for the same issue and I haven't found one similar.
Additional context
#19619 The issue first discussion, but no solution so far
Metadata
Metadata
Assignees
Labels
#bugBug reportBug report