Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Jinja Rules (JJ)


JJ01

Jinja tags must have single-space padding inside their delimiters.

This applies to both expression tags ({{ }}) and statement tags ({% %}).

-- bad: no spaces inside delimiters
select {{my_col}} from {{ref('my_model')}}
{% if condition %}

-- good
select {{ my_col }} from {{ ref('my_model') }}
{% if condition %}

Details

PatternExampleStatus
Expression, no padding{{col}}Flagged
Expression, correct padding{{ col }}OK
Statement, no padding{%if cond%}Flagged
Statement, correct padding{% if cond %}OK
Strip whitespace modifier{%- if cond -%}OK

The rule checks the raw tag text including delimiters. It does not parse the Jinja expression content.