superset icon indicating copy to clipboard operation
superset copied to clipboard

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

Open pankajsoni22 opened this issue 2 years ago • 2 comments

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

pankajsoni22 avatar Nov 02 '23 10:11 pankajsoni22

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.

sfirke avatar Nov 02 '23 16:11 sfirke

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 :)

rusackas avatar Apr 05 '24 17:04 rusackas

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.

aolwas avatar Apr 06 '24 07:04 aolwas