I'm using the jinja functions run_query and execute. https://docs.getdbt.com/reference/dbt-jinja-functions/run_query
But when sqlfluff lint I get the following error: Undefined jinja template variable: 'run_query'
I'm trying to add it to the .sqlfluff config but there doesn't seem to be any guidance anywhere on how to add this to the config file.
Any help would be greatly appreciated! Thanks
Add templater=dbt in your .sqlfluff config file.
More info here.
I have managed to figure out how to add run_query!
I was also unsure on how to add execute to the .sqlfluff config, but I figured it out!
[sqlfluff:templater:jinja:macros]
run_query = {% macro run_query(query) %}'query'{% endmacro %}
execute = {% macro execute() %}True{% endmacro %}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With