apache / superset

Apache Superset is a Data Visualization and Data Exploration Platform
https://superset.apache.org/
Apache License 2.0
62.72k stars 13.85k forks source link

Jinja execution is not happening when a dataset "sync columns" feature is used #25839

Open pankajsoni22 opened 1 year ago

pankajsoni22 commented 1 year ago

A clear and concise description of what the bug is.

How to reproduce the bug

  1. Go to a dataset which implements time filter 'from_dttm'/'to_dttm' jinja values to use them in the dataset.
  2. Click edit button on dataset
  3. Click on third tab "COLUMNS" (Refer the screenshot below)
  4. Click on "SYNC COLUMNS FROM SOURCE"
  5. Query throws the error about syntax error because does not execute Jinja

Expected results

It should sync the columns without any error

Actual results

Generate SQL syntax error as Jinja is not native to SQL.

Screenshots

image

Environment

Feature flags: ENABLE_TEMPLATE_PROCESSING=True

sfirke commented 1 year ago

Thanks for reporting. This behavior has existed for a while but I don't think is clearly documented like this. I use this workaround to sync columns: https://github.com/apache/superset/issues/21793#issuecomment-1384138580 Basically, delete the Jinja, sync columns, re-paste the Jinja again. But ideally having Jinja templating would not break the sync columns function.

rusackas commented 7 months ago

It's been about 5 months since this thread was last touched. Can anyone confirm if the issue still exists in 3.1.2 or 4.0? Otherwise this is at risk of being closed as stale, in assumption that the workaround is good enough for now :)

aolwas commented 7 months ago

The issue still exists at least in 3.1.1. I can't tell if a fix is available in last releases just looking at the changelogs.