how to assign value of environmental variable to variable in project yml file

Hi,
how to assign value of environmental variable to variable in project yml file

eg.
vars:
database_source: “{{ env_var(‘DBT_DATA_LAKE_DB’) }}”

This doesn’t work. When I assign the value to model source it just returns the string value and not the value of the environment variable.

sources:

  • name: schemaname
    database: “{{var(‘database_source’)}}”

the query is generated as {{ env_var(‘DBT_DATA_LAKE_DB’) }}.schemaname.tablename

i also tried the same, the variable is not holding the env var value.
Just wanna understand why you need to store the env var value in a variable as the value is stored in an environment variable and u can access the env variable directly.

there is no use case for me. I’m just trying to understand if that’s a limitation. Thank you for checking.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.