Daniel Lomartra
08/29/2022, 11:16 PM{
'dbt_env_var1': 'value1',
'dbt_env_var2': ['value2','value3','value4'],
'dbt_env_var3': {
'another_key': 'value5'
}
}
Will prefect accept this? will dbt_env_var2 and dbt_env_var3 be coercible back to their original data type in jinja or just passed as a string?{
"dbt_env_var1": "value1",
"dbt_env_var2": "[value2,value3,value4]",
"dbt_env_var3": "{another_key: value5}"
}
Then in dbt convert them to a the appropriate python object primitives:
{# list #}
{{ fromyaml(env_var('dbt_env_var2')) }}
{{ fromyaml(env_var('dbt_env_var2'))[0] }}
{# dictionary #}
{{ fromyaml(env_var('dbt_env_var3')) }}
{{ fromyaml(env_var('dbt_env_var3'))['another_key'] }}
These will compile to:
['value2', 'value3', 'value4']
value2
{'another_key': 'value5'}
value5