diff --git a/.sqlfluff b/.sqlfluff index 6cb7162d4..5c3be1223 100644 --- a/.sqlfluff +++ b/.sqlfluff @@ -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 @@ -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 \ No newline at end of file +#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" \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index c0dd77259..d3199ff3d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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' @@ -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" diff --git a/warehouse/dbt/models/intermediate/directory/stg_ossd__artifacts_by_project.sql b/warehouse/dbt/models/intermediate/directory/stg_ossd__artifacts_by_project.sql index 7ab619cc5..17f227500 100644 --- a/warehouse/dbt/models/intermediate/directory/stg_ossd__artifacts_by_project.sql +++ b/warehouse/dbt/models/intermediate/directory/stg_ossd__artifacts_by_project.sql @@ -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, diff --git a/warehouse/dbt/models/staging/github/stg_github__events.sql b/warehouse/dbt/models/staging/github/stg_github__events.sql index dba423921..452019daa 100644 --- a/warehouse/dbt/models/staging/github/stg_github__events.sql +++ b/warehouse/dbt/models/staging/github/stg_github__events.sql @@ -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 %}