Hello,
I’m unable to access directly indented variables in my models, that are defined in the vars from project.yml.
vars:
topic_group:
var_in_topic_1: value_1
var_in_topic_2: value_2
I’d like to be able to access directly the nested variable var_in_topic_1 inside my model.
Something like:
SELECT {{ var('topic_group.var_in_topic_1') }} AS CONFIG_VALUE_1
I keep getting variable not defined errors, I’ve tried a few methods for calling it.
But, I actually found the solution while writing the question:
SELECT {{ var('topic_group')['var_in_topic_1'] }} AS CONFIG_VALUE_1
The var in this case returns some kind of dict object that can be then used inside the curlies.
That works for me, I leave this here as it might help another newbie like me.