Skip to content

Commit

Permalink
fix: reconcile sqlfluff rules
Browse files Browse the repository at this point in the history
* Merging the sqlfluff config from pyproject.toml into .sqlfluff
  • Loading branch information
ryscheng committed May 3, 2024
1 parent 2753d57 commit db90e94
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 25 deletions.
15 changes: 12 additions & 3 deletions .sqlfluff
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ dialect = bigquery
templater = dbt
runaway_limit = 10
max_line_length = 80
indent_unit = space

[sqlfluff:indentation]
tab_space_size = 4
indent_unit = space
tab_space_size = 2

[sqlfluff:layout:type:comma]
spacing_before = touch
Expand Down Expand Up @@ -35,4 +35,13 @@ capitalisation_policy = lower

[sqlfluff:rules:ambiguous.column_references] # Number in group by
group_by_and_order_by_style = consistent
#group_by_and_order_by_style = explicit
#group_by_and_order_by_style = explicit

[sqlfluff.templater.jinja]
load_macros_from_path = "warehouse/dbt/macros/"
apply_dbt_builtins = true
library_path = "warehouse/common/dbtlintmock"

[sqlfluff.templater.dbt]
project_dir = "."
target = "playground"
20 changes: 0 additions & 20 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ dask = { extras = ["distributed"], version = "^2024.4.2" }
lz4 = "^4.3.3"
arrow = "^1.3.0"


[tool.poetry.scripts]
bq2cloudsql = 'bq2cloudsql.script:run'
oso_lets_go = 'oso_lets_go.wizard:run'
Expand All @@ -54,24 +53,5 @@ dagster-webserver = "^1.7.2"
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.sqlfluff]
max_line_length = 80

[tool.sqlfluff.core]
templater = "dbt"

[tool.sqlfluff.indentation]
indent_unit = "space"
tab_space_size = 2

[tool.sqlfluff.templater.jinja]
load_macros_from_path = "warehouse/dbt/macros/"
apply_dbt_builtins = true
library_path = "warehouse/common/dbtlintmock"

[tool.sqlfluff.templater.dbt]
project_dir = "."
target = "playground"

[tool.dagster]
module_name = "oso_dagster.definitions"
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ all_npm as (
LOWER(JSON_VALUE(npm.url)) like 'https://npmjs.com/package/%'
then SUBSTR(LOWER(JSON_VALUE(npm.url)), 28)
when
LOWER(JSON_VALUE(npm.url)) like 'https://www.npmjs.com/package/%'
LOWER(
JSON_VALUE(npm.url)
) like 'https://www.npmjs.com/package/%'
then SUBSTR(LOWER(JSON_VALUE(npm.url)), 31)
end as artifact_name,
LOWER(JSON_VALUE(npm.url)) as artifact_url,
Expand Down
3 changes: 2 additions & 1 deletion warehouse/dbt/models/staging/github/stg_github__events.sql
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ where
#}
and created_at
>= TIMESTAMP_SUB(
CURRENT_TIMESTAMP(), interval {{ env_var("PLAYGROUND_DAYS", '14') }} day
CURRENT_TIMESTAMP(),
interval {{ env_var("PLAYGROUND_DAYS", '14') }} day
)
{% endif %}

0 comments on commit db90e94

Please sign in to comment.