Official website: https://www.sqlfluff.com/
Questions tagged [sqlfluff]
40 questions
0
votes
2 answers
Sqlfluff: Cannot instantiate a templated file unsliced
I recently decided to add sqlfluff to my dbt project so i just followed https://docs.sqlfluff.com/en/stable/production.html and added sqlfluff with pre-commit to my project.
Following is how my very basic .sqlfluff configurations look…

d_mandy_1202
- 1
- 2
0
votes
1 answer
Sqlfluff rule L025 breaks due to postgres `generate_series()`
I'm using sqlfluff to lint my postges code. I'm down to a single linting error, in my test code, that I dont know how to fix by adjusting my sql nor how to configure it.
The rules im breaking is L025.
The issue is that sqlfluff thinks, i'm not using…

Norbert Bartko
- 2,468
- 1
- 17
- 36
0
votes
1 answer
Setting up github actions SQL linting
I am trying to setup a simple github actions workflow for sql linting using sqlfluff package. here is sunrise movement workflow which is simple and clean.
name: Lint Models
on: [pull_request]
jobs:
lint-models:
runs-on: ubuntu-latest
…

G1124E
- 407
- 1
- 10
- 20
0
votes
0 answers
How to avoid sqlfluff to add characters to unquoted identifiers while still linting the file?
How can I tell sqlfluff to do not add any character (in this case "_") after a number in an unquoted identifier?
For example, I want to lint a sql file with the following code:
SELECT
CAST(FIELD_2PY AS decimal(28, 6) ) AS FIELD_2PY,
…

Raul E. Menendez
- 61
- 6
0
votes
1 answer
sqlfluff with named parameters
I'm investigating linting SQL files in a project. sqlfluff seems good and I'm keen to get it integrated into the pre-commit checks for the project I'm working on.
However, the linter is currently producing false positives for any parameter use in…

moo
- 1,597
- 1
- 14
- 29
0
votes
2 answers
How to add a Jinja function to .sqlfluff config
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…

Squash
- 27
- 1
- 5
-1
votes
0 answers
SQLFLUFF doesn't parse dbt macros to fix even though they are not ignored in .sqlfluffignore
I have a dbt project which I wanna lint with SQLFLUFF and it consists of models and macros in which model calls macros as normal. Most of SQL codes are in macro files and models just simply call the relative macro.
The problem here is that SQLFLUFF…

Masoud
- 1
- 3
-1
votes
1 answer
Pre-commit hook skips files in directory
I'm trying to implement SQLFLUFF linter on a certain directory (models/market) on a repo. I'm using this command pre-commit run --files models/market/
what I see is that it is skipping .sql files inside the directory showing this…

Masoud
- 1
- 3
-1
votes
1 answer
GitHub Action sqlfluff ("The path(s) ('models',) could not be accessed.")
I have tried to add sqlfluff to the GitHub actions of a repository using these instructions (simply adding the file): https://github.com/sqlfluff/sqlfluff-github-actions/tree/main/menu_of_workflows/sunrise_movement
When pushing the branch with this…

Alex
- 7
- 3
-2
votes
1 answer
How to change max_line_length when running a DBT project?
I have a problem when run a DBT project. Some of my SQL commands are longer then the limit (80). So I have got the following error info:
I have tried to change the limit in dbt_project.yml and .sqlfluff. But none of the worked.
How to fix this…

Feng Chen
- 2,139
- 4
- 33
- 62