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

convert tests #2684

Merged
merged 1 commit into from
Aug 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

### Features
- Added a `dispatch` method to the context adapter and deprecated `adapter_macro`. ([#2302](https://github.com/fishtown-analytics/dbt/issues/2302), [#2679](https://github.com/fishtown-analytics/dbt/pull/2679))
- The built-in schema tests now use `adapter.dispatch`, so they can be overridden for adapter plugins ([#2415](https://github.com/fishtown-analytics/dbt/issues/2415), [#2684](https://github.com/fishtown-analytics/dbt/pull/2684))

## dbt 0.18.0b2 (July 30, 2020)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

{% macro test_accepted_values(model, values) %}
{% macro default__test_accepted_values(model, values) %}

{% set column_name = kwargs.get('column_name', kwargs.get('field')) %}
{% set quote_values = kwargs.get('quote', True) %}
Expand Down Expand Up @@ -35,3 +35,9 @@ select count(*) as validation_errors
from validation_errors

{% endmacro %}


{% macro test_accepted_values(model, values) %}
{% set macro = adapter.dispatch('test_accepted_values') %}
{{ macro(model, values, **kwargs) }}
{% endmacro %}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

{% macro test_not_null(model) %}
{% macro default__test_not_null(model) %}

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

Expand All @@ -9,3 +9,9 @@ where {{ column_name }} is null

{% endmacro %}



{% macro test_not_null(model) %}
{% set macro = adapter.dispatch('test_not_null') %}
{{ macro(model, **kwargs) }}
{% endmacro %}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

{% macro test_relationships(model, to, field) %}
{% macro default__test_relationships(model, to, field) %}

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

Expand All @@ -16,3 +16,9 @@ where child.id is not null

{% endmacro %}



{% macro test_relationships(model, to, field) %}
{% set macro = adapter.dispatch('test_relationships') %}
{{ macro(model, to, field, **kwargs) }}
{% endmacro %}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

{% macro test_unique(model) %}
{% macro default__test_unique(model) %}

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

Expand All @@ -17,3 +17,9 @@ from (
) validation_errors

{% endmacro %}


{% macro test_unique(model) %}
{% set macro = adapter.dispatch('test_unique') %}
{{ macro(model, **kwargs) }}
{% endmacro %}