I’m trying to use the config.get within a model file:
{{ config(tags=[“some category”],asofdate=“AS_OF_DATE_DAILYLOAD”) }}
{%- set as_of_dates_table=dbt.config.get(‘asofdate’,‘some default’-%}
—Fails with ref error
However, this works fine as a string
{%- set as_of_dates_table=‘AS_OF_DATE_DAILYLOAD’-%}
Surya
2
@rpitts
To access config fields u have to use config.get method but in the above example u have used dbt.config.get
rpitts
3
Weirdly I did try that:
{%- set as_of_dates_table=dbt.config.get(‘asofdate’,‘AS_OF_DATE_DAILYLOAD’)-%}
Received this error instead:
The name argument to ref() must be a string, got <class ‘dbt.clients.jinja.create_undefined..Undefined’>
rpitts
4
Any solution here in fixing this problem?
Surya
5
plz remove dbt.
and use
{%- set as_of_dates_table=config.get(‘asofdate’,‘AS_OF_DATE_DAILYLOAD’)-%}