Skip to content

"Unparsable section" on undefined jinja variable #5463

@golergka

Description

@golergka

Search before asking

  • I searched the issues and found no similar issues.

Probably related to #3728, but I'm not sure

What Happened

I'm getting an "unparsable section" error on undefined query variable.

Expected Behaviour

Error that variable is not defined

Observed Behaviour

Found unparsable section: '<function JinjaTemplater._generate_dbt_b...'

How to reproduce

(I'm using sqlfluff via the API, so I'll roughly translate the input query and config files that I create programmatically to source).

Query:

{{ var }}

Dialect

ansi

Version

2.3.0

Configuration

[sqlfluff]
dialect=ansi
processes=0
templater=jinja

[sqlfluff:templater:jinja:context]
# Empty section

Are you willing to work on and submit a PR to address the issue?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions