cbuffevant opened a new issue, #22261: URL: https://github.com/apache/superset/issues/22261
Templates used in dataset metrics are not being render at all when used in charts. #### How to reproduce the bug I was able to replicate the issue running Superset locally followint this instructions https://superset.apache.org/docs/installation/installing-superset-using-docker-compose. 1. Go to Datasets 2. Open `flights` dataset 3. Create a new metric with this information > name: my_metric > label: My Metric > SQL: sum(case when '{{ time_grain}}' = 'P1W' then 1 when '{{ time_grain}}' = 'P1D' then -1 else 0 end) 4. Save the dataset 5. Go to create a new Chart (for example, Time Series bar chart, v2) 6. Select `flights` dataset 7. Drop `My Metric` into the Metric section of the chart 8. Update the chart. 9. Create a new adhoc metric with the same SQL code than the dataset metric. 10. Update the chart. ### Expected results Both metrics should display the same information. ### Actual results The dataset metrics is set to 0 while the ad hoc metric has the right values. If you go to check the actual query, you will see that the template `{{ time_grain }}` is not rendered in the dataset metric case. #### Screenshots      ### Environment - browser type and version: Chrome 107.0.5304.110 (Official Build) (x86_64) - superset version: I just clone the repo and use non-dev docker-compose script. - python version: `3.10.6` - node.js version: `12.0` - any feature flags active: `ENABLE_TEMPLATE_PROCESSING` ### Checklist Make sure to follow these steps before submitting your issue - thank you! - [X] I have checked the superset logs for python stacktraces and included it here as text if there are any. (No stack trace produced). - [X] I have reproduced the issue with at least the latest released version of superset. - [X] I have checked the issue tracker for the same issue and I haven't found one similar. ### Additional context I uploaded a video to the Superset Slack channel with the steps to replicated it. https://apache-superset.slack.com/files/U02U4GLFWJC/F04CWRUQ1RR/superset_-_29_november_2022.mp4 -- 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]
