I am running sqlfluff lint
on a file and getting error:
L: 1 | P: 1 | TMP | Unrecoverable failure in Jinja templating: no loader for
| this environment specified. Have you configured your
| variables?
| https://docs.sqlfluff.com/en/latest/configuration.html
I have pored over the linked document but can’t figure out the problem. Below is a repro.
I have simply 2 files:
.
├── demo.sql
└── modules
└── grant_privilege_on_integration_to_role.j2
modules/grant_privilege_on_integration_to_role.j2 contains:
{% macro grant_privilege_on_integration(privilege, integration, role) -%}
GRANT {{privilege}} ON INTEGRATION {{integration}} TO ROLE {{role}};;
{%- endmacro %}
demo.sql contains:
{% from 'modules/grant_privilege_on_integration_to_role.j2' import grant_privilege_on_integration %}
when I run sqlfluff lint --dialect snowflake demo.sql
I get the error that you see above.
Can someone explain how I go about fixing this?