Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore/apply 717530c #967

Closed
wants to merge 28 commits into from
Closed
Changes from 3 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
d1a5bac
fix: extra brace typo in insert_by_period_materialization
tconbeer Jan 21, 2022
fba1cf9
Merge branch 'dbt-labs:main' into main
tconbeer May 5, 2022
7c4d7f2
chore: apply sqlfmt 0.8.0
tconbeer May 5, 2022
dbbc827
chore: apply sqlfmt 59e52a1073180668ddc6c53a2d1eb9450ebff329
tconbeer May 11, 2022
ddbb104
Merge branch 'main' into fix/trailing-commas
tconbeer May 11, 2022
a219241
Merge pull request #1 from tconbeer/fix/trailing-commas
tconbeer May 11, 2022
f6671f5
chore: apply sqlfmt 138e98e
tconbeer May 14, 2022
dd71818
Merge branch 'main' into chore/apply-138e98e
tconbeer May 14, 2022
7196170
Merge pull request #2 from tconbeer/chore/apply-138e98e
tconbeer May 14, 2022
cc17535
chore: apply sqlfmt d0e14b9 (#3)
tconbeer May 18, 2022
0695ce6
chore: apply sqlfmt aca4b6a (#4)
tconbeer Jun 13, 2022
a617b80
chore: apply sqlfmt e406e35 (#5)
tconbeer Jul 15, 2022
1afba0e
chore: apply sqlfmt fb99833 (#6)
tconbeer Jul 19, 2022
bfe3e2d
chore: apply sqlfmt bcf660d (#8)
tconbeer Aug 2, 2022
98ef570
chore: apply sqlfmt 6d33371 (#9)
tconbeer Aug 8, 2022
f676241
chore: apply sqlfmt 8b20379 (#10)
tconbeer Aug 17, 2022
55c9199
chore: apply sqlfmt 3e0f900 (#11)
tconbeer Aug 19, 2022
a70e75d
chore: apply sqlfmt b792a79 (#13)
tconbeer Nov 14, 2022
749446c
chore: apply sqlfmt a7ed980 (#14)
tconbeer Nov 30, 2022
eb7aec4
chore: apply sqlfmt 4f9a917 (#16)
tconbeer Dec 11, 2022
6170f77
chore: apply sqlfmt d620ac8 (#17)
tconbeer Jan 17, 2023
664fd68
chore: apply sqlfmt e6f9f4c (#18)
tconbeer Jan 17, 2023
8d81899
chore: apply sqlfmt d97af4e (#19)
tconbeer Jan 24, 2023
ab55e10
chore: apply sqlfmt 124890d (#20)
tconbeer Jan 26, 2023
ae160c9
chore: apply sqlfmt 54b8edd (#21)
tconbeer Apr 14, 2023
c62b99f
chore: apply sqlfmt 6e9615c (#22)
tconbeer May 10, 2023
72fe12f
chore: apply sqlfmt 717530c
tconbeer Nov 22, 2024
425b90a
Merge branch 'main' into chore/apply-717530c
tconbeer Nov 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions macros/generic_tests/mutually_exclusive_ranges.sql
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
upper_bound_column,
partition_by=None,
gaps="allowed",
zero_length_range_allowed=False,
zero_length_range_allowed=False
) %}
{{
return adapter.dispatch("test_mutually_exclusive_ranges", "dbt_utils")(
@@ -24,7 +24,7 @@
upper_bound_column,
partition_by=None,
gaps="allowed",
zero_length_range_allowed=False,
zero_length_range_allowed=False
) %}
{% if gaps == "not_allowed" %}
{% set allow_gaps_operator = "=" %} {% set allow_gaps_operator_in_words = "equal_to" %}
@@ -34,11 +34,9 @@
{% elif gaps == "required" %}
{% set allow_gaps_operator = "<" %} {% set allow_gaps_operator_in_words = "less_than" %}
{% else %}
{{
exceptions.raise_compiler_error(
"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '" ~ gaps ~"'.'"
)
}}
{{ exceptions.raise_compiler_error(
"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '" ~ gaps ~"'.'"
) }}
{% endif %}
{% if not zero_length_range_allowed %}
{% set allow_zero_length_operator = "<" %}
@@ -47,11 +45,9 @@
{% set allow_zero_length_operator = "<=" %}
{% set allow_zero_length_operator_in_words = "less_than_or_equal_to" %}
{% else %}
{{
exceptions.raise_compiler_error(
"`zero_length_range_allowed` argument for mutually_exclusive_ranges test must be one of [true, false] Got: '" ~ zero_length_range_allowed ~"'.'"
)
}}
{{ exceptions.raise_compiler_error(
"`zero_length_range_allowed` argument for mutually_exclusive_ranges test must be one of [true, false] Got: '" ~ zero_length_range_allowed ~"'.'"
) }}
{% endif %}

{% set partition_clause="partition by " ~ partition_by if partition_by else '' %}
8 changes: 3 additions & 5 deletions macros/generic_tests/unique_combination_of_columns.sql
Original file line number Diff line number Diff line change
@@ -19,11 +19,9 @@
{% set column_list = column_list.append(adapter.quote(column)) %}
{%- endfor %}
{% else %}
{{
exceptions.raise_compiler_error(
"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '" ~ quote ~"'.'"
)
}}
{{ exceptions.raise_compiler_error(
"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '" ~ quote ~"'.'"
) }}
{% endif %}

{%- set columns_csv = column_list | join(", ") %}
16 changes: 7 additions & 9 deletions macros/materializations/insert_by_period_materialization.sql
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
timestamp_field,
start_date,
stop_date,
period,
period
) -%}
{{
return adapter.dispatch("get_period_boundaries", "dbt_utils")(
@@ -19,7 +19,7 @@
timestamp_field,
start_date,
stop_date,
period,
period
) -%}

{% call statement('period_boundaries', fetch_result=True) -%}
@@ -30,11 +30,9 @@ with
max("{{timestamp_field}}"), '{{start_date}}'
)::timestamp as start_timestamp,
coalesce(
{{
dbt_utils.dateadd('millisecond',
-1,
"nullif('" ~ stop_date ~ "','')::timestamp")
}},
{{dbt_utils.dateadd('millisecond',
-1,
"nullif('" ~ stop_date ~ "','')::timestamp")}},
{{ dbt_utils.current_timestamp() }}
) as stop_timestamp
from "{{target_schema}}"."{{target_table}}"
@@ -57,7 +55,7 @@ from data {%- endcall %}
period,
start_timestamp,
stop_timestamp,
offset,
offset
) -%}
{{
return adapter.dispatch("get_period_sql", "dbt_utils")(
@@ -79,7 +77,7 @@ from data {%- endcall %}
period,
start_timestamp,
stop_timestamp,
offset,
offset
) -%}

{%- set period_filter -%}
14 changes: 6 additions & 8 deletions macros/sql/get_tables_by_prefix_sql.sql
Original file line number Diff line number Diff line change
@@ -12,13 +12,11 @@
schema, prefix, exclude="", database=target.database
) %}

{{
dbt_utils.get_tables_by_pattern_sql(
schema_pattern = schema,
table_pattern = prefix ~ '%',
exclude = exclude,
database = database
)
}}
{{ dbt_utils.get_tables_by_pattern_sql(
schema_pattern = schema,
table_pattern = prefix ~ '%',
exclude = exclude,
database = database
) }}

{% endmacro %}
4 changes: 2 additions & 2 deletions macros/sql/pivot.sql
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ Arguments:
then_value=1,
else_value=0,
quote_identifiers=True,
distinct=False,
distinct=False
) %}
{{
return adapter.dispatch("pivot", "dbt_utils")(
@@ -80,7 +80,7 @@ Arguments:
then_value=1,
else_value=0,
quote_identifiers=True,
distinct=False,
distinct=False
) %}
{% for value in values %}
{{ agg }} (
4 changes: 2 additions & 2 deletions macros/sql/union.sql
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
column_override=none,
include=[],
exclude=[],
source_column_name="_dbt_source_relation",
source_column_name="_dbt_source_relation"
) -%}
{{
return adapter.dispatch("union_relations", "dbt_utils")(
@@ -17,7 +17,7 @@
column_override=none,
include=[],
exclude=[],
source_column_name="_dbt_source_relation",
source_column_name="_dbt_source_relation"
) -%}

{%- if exclude and include -%}
4 changes: 2 additions & 2 deletions macros/sql/unpivot.sql
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ Arguments:
remove=none,
field_name="field_name",
value_name="value",
table=none,
table=none
) -%}
{{
return adapter.dispatch("unpivot", "dbt_utils")(
@@ -34,7 +34,7 @@ Arguments:
remove=none,
field_name="field_name",
value_name="value",
table=none,
table=none
) -%}

{% if table %}