QuestionQ54

Verified

You have just run dbt run on this model:

select * from \{\{ source("\{\{ env_var('input') \}\}", 'table_name') \}\}  

You received this error:

Compilation Error in model my_model expected token ':', got '\}'  
line 14  
\{\{ source(\{\{ env_var('input') \}\}, 'table_name') \}\}.  

How can you debug it?

Explanation

Jinja delimiters should not be nested inside an existing Jinja expression. Pass the function result directly, as in {{ source(env_var('input'), 'table_name') }}. The error excerpt shows nested delimiters; the quoted expression in the displayed model is different and would instead be treated as a literal string. (docs.getdbt.com)

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!