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

dispatch-ify ALL THE MACROS! #312

Merged
merged 30 commits into from
Jan 10, 2021
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
844bfa1
dispatch-ify schema tests
dataders Dec 23, 2020
16bd69a
typo
dataders Dec 23, 2020
fe36124
generalized macros
chaerinlee1 Jan 4, 2021
3e886be
generalized macros progress
chaerinlee1 Jan 4, 2021
730f7a1
remove prefix from tests
dataders Jan 4, 2021
21be8a4
add keyword args to adapter.disptach() arg list
dataders Jan 4, 2021
d35737c
HAIL MARY find logger macros
dataders Jan 4, 2021
1c6ff84
for discovery in user projects & other pkgs
dataders Jan 4, 2021
61d0dd1
for discovery in user projects & other pkgs
dataders Jan 4, 2021
ae8d040
generalize rest of macros
chaerinlee1 Jan 5, 2021
e3417af
datatype bug fix
chaerinlee1 Jan 5, 2021
b3428bc
datatype bug fix to all macros
chaerinlee1 Jan 5, 2021
6893304
compilation error bug fix
chaerinlee1 Jan 5, 2021
274a09b
undo last commit
chaerinlee1 Jan 5, 2021
832f2ef
dispatch shouldn't override macro signature
dataders Jan 5, 2021
f940504
macro uses varargs
dataders Jan 5, 2021
cd40119
missing close paren
dataders Jan 5, 2021
b4aa854
macro uses varargs
dataders Jan 5, 2021
b5a14ef
hail mary
dataders Jan 5, 2021
c9cfad1
whisper Jinja sweet nothings
dataders Jan 5, 2021
39775c6
sweet hail mary nothings
dataders Jan 5, 2021
278514b
give the Jinja what it wants
dataders Jan 5, 2021
9bd577b
goodnight sweet Jinja
dataders Jan 5, 2021
bb3bf4e
keep dispatch from overriding args
dataders Jan 5, 2021
66f0bb0
stop dispatch from overridding args
dataders Jan 5, 2021
7406f45
removed default args
chaerinlee1 Jan 5, 2021
2cb81ff
undo small tweak
dataders Jan 5, 2021
178cdbb
not needed
dataders Jan 6, 2021
e4004c7
Merge branch 'master' of https://github.com/fishtown-analytics/dbt-ut…
dataders Jan 8, 2021
20034bd
for posterity
dataders Jan 8, 2021
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
3 changes: 3 additions & 0 deletions integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ clean-targets: # directories to be removed by `dbt clean`
- "target"
- "dbt_modules"

vars:
dbt_utils_dispatch_list: ['dbt_utils']

dataders marked this conversation as resolved.
Show resolved Hide resolved
seeds:

+quote_columns: false
Expand Down
2 changes: 1 addition & 1 deletion macros/cross_db_utils/concat.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@


{% macro concat(fields) -%}
{{ adapter.dispatch('concat', packages = dbt_utils._get_utils_namespaces())(fields) }}
{{ return(adapter.dispatch('concat', packages = dbt_utils._get_utils_namespaces())(fields)) }}
{%- endmacro %}

{% macro default__concat(fields) -%}
Expand Down
4 changes: 2 additions & 2 deletions macros/cross_db_utils/current_timestamp.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% macro current_timestamp() -%}
{{ adapter.dispatch('current_timestamp', packages = dbt_utils._get_utils_namespaces())() }}
{{ return(adapter.dispatch('current_timestamp', packages = dbt_utils._get_utils_namespaces())()) }}
{%- endmacro %}

{% macro default__current_timestamp() %}
Expand All @@ -17,7 +17,7 @@


{% macro current_timestamp_in_utc() -%}
{{ adapter.dispatch('current_timestamp_in_utc', packages = dbt_utils._get_utils_namespaces())() }}
{{ return(adapter.dispatch('current_timestamp_in_utc', packages = dbt_utils._get_utils_namespaces())()) }}
{%- endmacro %}

{% macro default__current_timestamp_in_utc() %}
Expand Down
12 changes: 6 additions & 6 deletions macros/cross_db_utils/datatypes.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{# string ------------------------------------------------- #}

{%- macro type_string() -%}
{{ adapter.dispatch('type_string', packages = dbt_utils._get_utils_namespaces())() }}
{{ return(adapter.dispatch('type_string', packages = dbt_utils._get_utils_namespaces())()) }}
{%- endmacro -%}

{% macro default__type_string() %}
Expand All @@ -25,7 +25,7 @@
{# timestamp ------------------------------------------------- #}

{%- macro type_timestamp() -%}
{{ adapter.dispatch('type_timestamp', packages = dbt_utils._get_utils_namespaces())() }}
{{ return(adapter.dispatch('type_timestamp', packages = dbt_utils._get_utils_namespaces())()) }}
{%- endmacro -%}

{% macro default__type_timestamp() %}
Expand All @@ -40,7 +40,7 @@
{# float ------------------------------------------------- #}

{%- macro type_float() -%}
{{ adapter.dispatch('type_float', packages = dbt_utils._get_utils_namespaces())() }}
{{ return(adapter.dispatch('type_float', packages = dbt_utils._get_utils_namespaces())()) }}
{%- endmacro -%}

{% macro default__type_float() %}
Expand All @@ -54,7 +54,7 @@
{# numeric ------------------------------------------------ #}

{%- macro type_numeric() -%}
{{ adapter.dispatch('type_numeric', packages = dbt_utils._get_utils_namespaces())() }}
{{ return(adapter.dispatch('type_numeric', packages = dbt_utils._get_utils_namespaces())()) }}
{%- endmacro -%}

{% macro default__type_numeric() %}
Expand All @@ -69,7 +69,7 @@
{# bigint ------------------------------------------------- #}

{%- macro type_bigint() -%}
{{ adapter.dispatch('type_bigint', packages = dbt_utils._get_utils_namespaces())() }}
{{ return(adapter.dispatch('type_bigint', packages = dbt_utils._get_utils_namespaces())()) }}
{%- endmacro -%}

{% macro default__type_bigint() %}
Expand All @@ -83,7 +83,7 @@
{# int ------------------------------------------------- #}

{%- macro type_int() -%}
{{ adapter.dispatch('type_int', packages = dbt_utils._get_utils_namespaces())() }}
{{ return(adapter.dispatch('type_int', packages = dbt_utils._get_utils_namespaces())()) }}
{%- endmacro -%}

{% macro default__type_int() %}
Expand Down
2 changes: 1 addition & 1 deletion macros/cross_db_utils/date_trunc.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% macro date_trunc(datepart, date) -%}
{{ adapter.dispatch('date_trunc', packages = dbt_utils._get_utils_namespaces()) (datepart, date) }}
{{ return(adapter.dispatch('date_trunc', packages = dbt_utils._get_utils_namespaces()) (datepart, date)) }}
{%- endmacro %}

{% macro default__date_trunc(datepart, date) %}
Expand Down
2 changes: 1 addition & 1 deletion macros/cross_db_utils/dateadd.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% macro dateadd(datepart, interval, from_date_or_timestamp) %}
{{ adapter.dispatch('dateadd', packages = dbt_utils._get_utils_namespaces())(datepart, interval, from_date_or_timestamp) }}
{{ return(adapter.dispatch('dateadd', packages = dbt_utils._get_utils_namespaces())(datepart, interval, from_date_or_timestamp)) }}
{% endmacro %}


Expand Down
2 changes: 1 addition & 1 deletion macros/cross_db_utils/datediff.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% macro datediff(first_date, second_date, datepart) %}
{{ adapter.dispatch('datediff', packages = dbt_utils._get_utils_namespaces())(first_date, second_date, datepart) }}
{{ return(adapter.dispatch('datediff', packages = dbt_utils._get_utils_namespaces())(first_date, second_date, datepart)) }}
{% endmacro %}


Expand Down
2 changes: 1 addition & 1 deletion macros/cross_db_utils/except.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% macro except() %}
{{ adapter.dispatch('except', packages = dbt_utils._get_utils_namespaces())() }}
{{ return(adapter.dispatch('except', packages = dbt_utils._get_utils_namespaces())()) }}
{% endmacro %}


Expand Down
2 changes: 1 addition & 1 deletion macros/cross_db_utils/hash.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% macro hash(field) -%}
{{ adapter.dispatch('hash', packages = dbt_utils._get_utils_namespaces()) (field) }}
{{ return(adapter.dispatch('hash', packages = dbt_utils._get_utils_namespaces()) (field)) }}
{%- endmacro %}


Expand Down
2 changes: 1 addition & 1 deletion macros/cross_db_utils/identifier.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Use `adapter.quote` instead. The {}.{} model triggered this warning. \
'.format(model.package_name, model.name) -%}
{%- do exceptions.warn(error_message) -%}
{{ adapter.dispatch('identifier', packages = dbt_utils._get_utils_namespaces()) (value) }}
{{ return(adapter.dispatch('identifier', packages = dbt_utils._get_utils_namespaces()) (value)) }}
{% endmacro %}

{% macro default__identifier(value) -%}
Expand Down
2 changes: 1 addition & 1 deletion macros/cross_db_utils/intersect.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% macro intersect() %}
{{ adapter.dispatch('intersect', packages = dbt_utils._get_utils_namespaces())() }}
{{ return(adapter.dispatch('intersect', packages = dbt_utils._get_utils_namespaces())()) }}
{% endmacro %}


Expand Down
2 changes: 1 addition & 1 deletion macros/cross_db_utils/last_day.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ testing is required to validate that it will work on other dateparts.
*/

{% macro last_day(date, datepart) %}
{{ adapter.dispatch('last_day', packages = dbt_utils._get_utils_namespaces()) (date, datepart) }}
{{ return(adapter.dispatch('last_day', packages = dbt_utils._get_utils_namespaces()) (date, datepart)) }}
{% endmacro %}


Expand Down
2 changes: 1 addition & 1 deletion macros/cross_db_utils/length.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% macro length(expression) -%}
{{ adapter.dispatch('length', packages = dbt_utils._get_utils_namespaces()) (expression) }}
{{ return(adapter.dispatch('length', packages = dbt_utils._get_utils_namespaces()) (expression)) }}
{% endmacro %}


Expand Down
2 changes: 1 addition & 1 deletion macros/cross_db_utils/literal.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

{%- macro string_literal(value) -%}
{{ adapter.dispatch('string_literal', packages = dbt_utils._get_utils_namespaces()) (value) }}
{{ return(adapter.dispatch('string_literal', packages = dbt_utils._get_utils_namespaces()) (value)) }}
{%- endmacro -%}

{% macro default__string_literal(value) -%}
Expand Down
2 changes: 1 addition & 1 deletion macros/cross_db_utils/position.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% macro position(substring_text, string_text) -%}
{{ adapter.dispatch('position', packages = dbt_utils._get_utils_namespaces()) (substring_text, string_text) }}
{{ return(adapter.dispatch('position', packages = dbt_utils._get_utils_namespaces()) (substring_text, string_text)) }}
{% endmacro %}


Expand Down
2 changes: 1 addition & 1 deletion macros/cross_db_utils/replace.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% macro replace(field, old_chars, new_chars) -%}
{{ adapter.dispatch('replace', packages = dbt_utils._get_utils_namespaces()) (field, old_chars, new_chars) }}
{{ return(adapter.dispatch('replace', packages = dbt_utils._get_utils_namespaces()) (field, old_chars, new_chars)) }}
{% endmacro %}


Expand Down
2 changes: 1 addition & 1 deletion macros/cross_db_utils/right.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% macro right(string_text, length_expression) -%}
{{ adapter.dispatch('right', packages = dbt_utils._get_utils_namespaces()) (string_text, length_expression) }}
{{ return(adapter.dispatch('right', packages = dbt_utils._get_utils_namespaces()) (string_text, length_expression)) }}
{% endmacro %}

{% macro default__right(string_text, length_expression) %}
Expand Down
2 changes: 1 addition & 1 deletion macros/cross_db_utils/safe_cast.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% macro safe_cast(field, type) %}
{{ adapter.dispatch('safe_cast', packages = dbt_utils._get_utils_namespaces()) (field, type) }}
{{ return(adapter.dispatch('safe_cast', packages = dbt_utils._get_utils_namespaces()) (field, type)) }}
{% endmacro %}


Expand Down
2 changes: 1 addition & 1 deletion macros/cross_db_utils/split_part.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% macro split_part(string_text, delimiter_text, part_number) %}
{{ adapter.dispatch('split_part', packages = dbt_utils._get_utils_namespaces()) (string_text, delimiter_text, part_number) }}
{{ return(adapter.dispatch('split_part', packages = dbt_utils._get_utils_namespaces()) (string_text, delimiter_text, part_number)) }}
{% endmacro %}


Expand Down
2 changes: 1 addition & 1 deletion macros/cross_db_utils/width_bucket.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% macro width_bucket(expr, min_value, max_value, num_buckets) %}
{{ adapter.dispatch('width_bucket', packages = dbt_utils._get_utils_namespaces()) (expr, min_value, max_value, num_buckets) }}
{{ return(adapter.dispatch('width_bucket', packages = dbt_utils._get_utils_namespaces()) (expr, min_value, max_value, num_buckets)) }}
{% endmacro %}


Expand Down
7 changes: 7 additions & 0 deletions macros/datetime/date_spine.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{% macro get_intervals_between(start_date, end_date, datepart) -%}
{{ return(adapter.dispatch('get_intervals_between', packages = dbt_utils._get_utils_namespaces())(start_date, end_date, datepart)) }}
{%- endmacro %}

{% macro default__get_intervals_between(start_date, end_date, datepart) -%}
{%- call statement('get_intervals_between', fetch_result=True) %}

select {{dbt_utils.datediff(start_date, end_date, datepart)}}
Expand All @@ -21,6 +24,10 @@


{% macro date_spine(datepart, start_date, end_date) %}
{{ return(adapter.dispatch('date_spine', packages = dbt_utils._get_utils_namespaces())(datepart, start_date, end_date)) }}
{%- endmacro %}

{% macro default__date_spine(datepart, start_date, end_date) %}

/*
call as follows:
Expand Down
4 changes: 4 additions & 0 deletions macros/geo/haversine_distance.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ The arguments should be float type.
#}

{% macro haversine_distance(lat1,lon1,lat2,lon2) -%}
{{ return(adapter.dispatch('haversine_distance', packages = dbt_utils._get_utils_namespaces())(lat1,lon1,lat2,lon2)) }}
{% endmacro %}

{% macro default__haversine_distance(lat1,lon1,lat2,lon2) -%}

2 * 3961 * asin(sqrt((sin(radians(({{lat2}} - {{lat1}}) / 2))) ^ 2 +
cos(radians({{lat1}})) * cos(radians({{lat2}})) *
Expand Down
4 changes: 3 additions & 1 deletion macros/logger/log_info.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{% macro log_info(message) %}
{{ return(adapter.dispatch('log_info', packages = dbt_utils._get_utils_namespaces())(message)) }}
{% endmacro %}

{% macro default__log_info(message) %}
{{ log(dbt_utils.pretty_log_format(message), info=True) }}

{% endmacro %}
4 changes: 3 additions & 1 deletion macros/logger/pretty_log_format.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{% macro pretty_log_format(message) %}
{{ return(adapter.dispatch('pretty_log_format', packages = dbt_utils._get_utils_namespaces())(message)) }}
{% endmacro %}

{% macro default__pretty_log_format(message) %}
{{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}

{% endmacro %}
4 changes: 3 additions & 1 deletion macros/logger/pretty_time.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{% macro pretty_time(format='%H:%M:%S') %}
{{ return(adapter.dispatch('pretty_time', packages = dbt_utils._get_utils_namespaces())(format='%H:%M:%S')) }}
{% endmacro %}

{% macro default__pretty_time(format='%H:%M:%S') %}
{{ return(modules.datetime.datetime.now().strftime(format)) }}

{% endmacro %}
8 changes: 8 additions & 0 deletions macros/materializations/insert_by_period_materialization.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{% macro get_period_boundaries(target_schema, target_table, timestamp_field, start_date, stop_date, period) -%}
{{ return(adapter.dispatch('get_period_boundaries', packages = dbt_utils._get_utils_namespaces())(target_schema, target_table, timestamp_field, start_date, stop_date, period)) }}
{% endmacro %}

{% macro default__get_period_boundaries(target_schema, target_table, timestamp_field, start_date, stop_date, period) -%}

{% call statement('period_boundaries', fetch_result=True) -%}
with data as (
Expand All @@ -25,6 +29,10 @@
{%- endmacro %}

{% macro get_period_sql(target_cols_csv, sql, timestamp_field, period, start_timestamp, stop_timestamp, offset) -%}
{{ return(adapter.dispatch('get_period_sql', packages = dbt_utils._get_utils_namespaces())(target_cols_csv, sql, timestamp_field, period, start_timestamp, stop_timestamp, offset)) }}
{% endmacro %}

{% macro default__get_period_sql(target_cols_csv, sql, timestamp_field, period, start_timestamp, stop_timestamp, offset) -%}

{%- set period_filter -%}
("{{timestamp_field}}" > '{{start_timestamp}}'::timestamp + interval '{{offset}} {{period}}' and
Expand Down
6 changes: 5 additions & 1 deletion macros/schema_tests/at_least_one.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{% macro test_at_least_one(model) %}
{{ return(adapter.dispatch('test_at_least_one', packages = dbt_utils._get_utils_namespaces())(model, **kwargs)) }}
dataders marked this conversation as resolved.
Show resolved Hide resolved
{% endmacro %}

{% macro default__test_at_least_one(model) %}

{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}

Expand All @@ -14,4 +18,4 @@ from (

) validation_errors

{% endmacro %}
{% endmacro %}
5 changes: 5 additions & 0 deletions macros/schema_tests/cardinality_equality.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{% macro test_cardinality_equality(model, to, field) %}
{{ return(adapter.dispatch('test_cardinality_equality', packages = dbt_utils._get_utils_namespaces())(model, to, field, **kwargs)) }}

{% endmacro %}

{% macro default__test_cardinality_equality(model, to, field) %}

{% set column_name = kwargs.get('column_name', kwargs.get('from')) %}

Expand Down
4 changes: 4 additions & 0 deletions macros/schema_tests/equal_rowcount.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{% macro test_equal_rowcount(model) %}
{{ return(adapter.dispatch('test_equal_rowcount', packages = dbt_utils._get_utils_namespaces())(model, **kwargs)) }}
{% endmacro %}

{% macro default__test_equal_rowcount(model) %}

{% set compare_model = kwargs.get('compare_model', kwargs.get('arg')) %}

Expand Down
4 changes: 4 additions & 0 deletions macros/schema_tests/equality.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{% macro test_equality(model) %}
{{ return(adapter.dispatch('test_equality', packages = dbt_utils._get_utils_namespaces())(model, **kwargs)) }}
{% endmacro %}

{% macro default__test_equality(model) %}


{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}
Expand Down
4 changes: 4 additions & 0 deletions macros/schema_tests/expression_is_true.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{% macro test_expression_is_true(model, condition='true') %}
dataders marked this conversation as resolved.
Show resolved Hide resolved
{{ return(adapter.dispatch('test_expression_is_true', packages = dbt_utils._get_utils_namespaces())(model, condition='true', **kwargs)) }}
{% endmacro %}

{% macro default__test_expression_is_true(model, condition='true') %}

{% set expression = kwargs.get('expression', kwargs.get('arg')) %}

Expand Down
4 changes: 4 additions & 0 deletions macros/schema_tests/mutually_exclusive_ranges.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{% macro test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed') %}
{{ return(adapter.dispatch('test_mutually_exclusive_ranges', packages = dbt_utils._get_utils_namespaces())(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed')) }}
{% endmacro %}

{% macro default__test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed') %}

{% if gaps == 'not_allowed' %}
{% set allow_gaps_operator='=' %}
Expand Down
4 changes: 4 additions & 0 deletions macros/schema_tests/not_constant.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@

{% macro test_not_constant(model) %}
{{ return(adapter.dispatch('test_not_constant', packages = dbt_utils._get_utils_namespaces())(model, **kwargs)) }}
{% endmacro %}

{% macro default__test_not_constant(model) %}

{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}

Expand Down
4 changes: 4 additions & 0 deletions macros/schema_tests/recency.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{% macro test_recency(model, datepart, interval) %}
{{ return(adapter.dispatch('test_recency', packages = dbt_utils._get_utils_namespaces())(model, datepart, interval, **kwargs)) }}
{% endmacro %}

{% macro default__test_recency(model, datepart, interval) %}

{% set column_name = kwargs.get('column_name', kwargs.get('field')) %}

Expand Down
4 changes: 4 additions & 0 deletions macros/schema_tests/relationships_where.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{% macro test_relationships_where(model, to, field) %}
{{ return(adapter.dispatch('test_relationships_where', packages = dbt_utils._get_utils_namespaces())(model, to, field, **kwargs)) }}
{% endmacro %}

{% macro default__test_relationships_where(model, to, field) %}

{% set column_name = kwargs.get('column_name', kwargs.get('from')) %}
{% set from_condition = kwargs.get('from_condition', "true") %}
Expand Down
4 changes: 4 additions & 0 deletions macros/schema_tests/test_not_null_where.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{% macro test_not_null_where(model) %}
{{ return(adapter.dispatch('test_not_null_where', packages = dbt_utils._get_utils_namespaces())(model, **kwargs)) }}
{% endmacro %}

{% macro default__test_not_null_where(model) %}

{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}
{% set where = kwargs.get('where', kwargs.get('arg')) %}
Expand Down
4 changes: 4 additions & 0 deletions macros/schema_tests/test_unique_where.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{% macro test_unique_where(model) %}
{{ return(adapter.dispatch('test_unique_where', packages = dbt_utils._get_utils_namespaces())(model, **kwargs)) }}
{% endmacro %}

{% macro default__test_unique_where(model) %}

{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}
{% set where = kwargs.get('where', kwargs.get('arg')) %}
Expand Down
Loading