You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If we use the word "from" or "join" in a Jinja comment block the parser thinks that the next word is the name of a table or CTE and passes an error.
sql:
{# This is a test of the check-script-has-no-table-name hook, from pre-commit-dbt
We would expect the hook to ignore this text because it is in a jinja comment block
and not actually a join to any other table.
#}
output from pre-commit run
Check the script has not table name......................................Failed
- hook id: check-script-has-no-table-name
- exit code: 1
test.sql: does not use source() or ref() macros for tables:
- pre-commit-dbt
- to
To Reproduce
Steps to reproduce the behavior:
create a new sql file
add into the file
{# This is a test of the check-script-has-no-table-name hook, from pre-commit-dbt
We would expect the hook to ignore this text because it is in a jinja comment block
and not actually a join to any other table.
#}
Run pre-commit with the check-script-has-no-table-name hook enabled
Expected behavior
I'd expect the parser to ignore comment blocks since it's not important if they don't use ref() or source()
Version:
v0.1.1
The text was updated successfully, but these errors were encountered:
Good catch @neddonaldson!! Thanks a lot. I fixed that in #11. If you do not wait for a new version of pre-commit-dbt you can run pre-commit autoupdate --bleeding-edge to update to HEAD.
Describe the bug
If we use the word "from" or "join" in a Jinja comment block the parser thinks that the next word is the name of a table or CTE and passes an error.
sql:
output from
pre-commit run
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I'd expect the parser to ignore comment blocks since it's not important if they don't use
ref() or source()
Version:
v0.1.1
The text was updated successfully, but these errors were encountered: