英文:
How to change max_line_length when running a DBT project?
问题
我运行一个DBT项目时遇到了问题。我的一些SQL命令超过了限制(80个字符)。因此,我收到了以下错误信息:
我尝试过在dbt_project.yml和.sqlfluff中更改限制,但都没有生效。
如何解决这个问题并更改长度限制?
英文:
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 problem and change the length limit?
答案1
得分: 1
这是一个与代码检查相关的问题,所以很可能与你的 dbt_project.yml
无关。
为了正确设置 .sqlfluff
文件中的 max_line_length
值,你需要将它嵌套在 [sqlfluff]
标签下。也就是说,你的 .sqlfluff
文件应该如下所示:
[sqlfluff]
dialect = snowflake
exclude_rules = L031
max_line_length = 120
查看 SQLFluff 文档中的示例这里。
英文:
That's a linter-related issue, so most probably nothing to do with your dbt_project.yml
.
In order to correctly set a max_line_length
value in your .sqlfluff
file, you need to nest it under the [sqlfluff]
tag. Meaning that your .sqlfluff
file should look like this:
[sqlfluff]
dialect = snowflake
exclude_rules = L031
max_line_length = 120
See this example for SQLFluff's docs here.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论