1
votes

I have declared a variable inside dbt_project.yml as

vars:
    deva: CEMD_RAW

and i am using this inside my models file as

 select *
from {{ source("{{ var('deva')}}", 'table_name') }}

but when i compile the file it says source named '{{ var('deva') }}.table_name' was not found. What is the correct way to refer the variable.

1

1 Answers

2
votes

Once you're in your Jinja 'double curlies', you don't need to nest another set off curlies in it, aka Don't Nest Your Curlies.

The correct way to do this would be:

select *
from {{ source(var('deva'), 'table_name') }}