-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: staging and mart models (#1359)
* Add a .sqlfluff to match dbt style guide * Add .sqlfluffignore for anything outside of dbt right now * Fixed up the staging and mart models. NOTE: This is currently broken, the intermediate models have not yet been fixed to connect the 2 ends
- Loading branch information
Showing
133 changed files
with
2,391 additions
and
2,278 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
[sqlfluff] | ||
dialect = bigquery | ||
templater = dbt | ||
runaway_limit = 10 | ||
max_line_length = 80 | ||
indent_unit = space | ||
|
||
[sqlfluff:indentation] | ||
tab_space_size = 4 | ||
|
||
[sqlfluff:layout:type:comma] | ||
spacing_before = touch | ||
line_position = trailing | ||
|
||
[sqlfluff:rules:capitalisation.keywords] | ||
capitalisation_policy = lower | ||
|
||
[sqlfluff:rules:aliasing.table] | ||
aliasing = explicit | ||
|
||
[sqlfluff:rules:aliasing.column] | ||
aliasing = explicit | ||
|
||
[sqlfluff:rules:aliasing.expression] | ||
allow_scalar = False | ||
|
||
[sqlfluff:rules:capitalisation.identifiers] | ||
extended_capitalisation_policy = lower | ||
|
||
[sqlfluff:rules:capitalisation.functions] | ||
capitalisation_policy = lower | ||
|
||
[sqlfluff:rules:capitalisation.literals] | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
# dbt-related | ||
/target/ | ||
/dbt_packages/ | ||
/warehouse/dbt/macros/ | ||
|
||
# Non-dbt SQL | ||
/apps/ | ||
/ops/ | ||
/warehouse/oso_dagster/ | ||
|
||
# Dependencies | ||
/.venv/ | ||
/node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
{% macro oso_artifact_id(prefix, table_alias="") -%} | ||
{%- set _prefix = prefix -%} | ||
{%- if not prefix.endswith('_') and prefix != "" %} | ||
{%- set _prefix = prefix + '_' -%} | ||
{% endif -%} | ||
{%- if table_alias != "" %} | ||
{%- set _prefix = "%s.%s" % (table_alias, _prefix) -%} | ||
{% endif -%} | ||
{%- set namespace = "%s%s" % (_prefix, 'namespace') -%} | ||
{%- set source_id = "%s%s" % (_prefix, 'source_id') -%} | ||
{%- set type = "%s%s" % (_prefix, 'type') -%} | ||
{{- oso_id(namespace, type, source_id) -}} | ||
{%- set _prefix = prefix -%} | ||
{%- if not prefix.endswith('_') and prefix != "" %} | ||
{%- set _prefix = prefix + '_' -%} | ||
{% endif -%} | ||
{%- if table_alias != "" %} | ||
{%- set _prefix = "%s.%s" % (table_alias, _prefix) -%} | ||
{% endif -%} | ||
{%- set namespace = "%s%s" % (_prefix, 'namespace') -%} | ||
{%- set source_id = "%s%s" % (_prefix, 'source_id') -%} | ||
{%- set type = "%s%s" % (_prefix, 'type') -%} | ||
{{- oso_id(namespace, type, source_id) -}} | ||
{%- endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{# Generates an ID for OSO. For now this is done by creating a url safe base64 encoding of a SHA256 #} | ||
{% macro oso_id() -%} | ||
{%- set id_bytes = 'SHA256(CONCAT(' + ', '.join(varargs) + '))' -%} | ||
{{- urlsafe_base64(id_bytes) -}} | ||
{%- set id_bytes = 'SHA256(CONCAT(' + ', '.join(varargs) + '))' -%} | ||
{{- urlsafe_base64(id_bytes) -}} | ||
{%- endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{# urlsafe_base64 Macro #} | ||
{% macro urlsafe_base64(bytes_column) -%} | ||
REPLACE(REPLACE(TO_BASE64({{ bytes_column }}), '+', '-'), '/', '_') | ||
REPLACE(REPLACE(TO_BASE64({{ bytes_column }}), '+', '-'), '/', '_') | ||
{%- endmacro %} |
182 changes: 0 additions & 182 deletions
182
warehouse/dbt/models/intermediate/collection_metrics/int_code_metrics_by_collection.sql
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.