diff --git a/README.md b/README.md index c1437e22..3c9d46d7 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,6 @@ Check [dbt Hub](https://hub.getdbt.com/dbt-labs/dbt_utils/latest/) for the lates - [not_constant](#not_constant-source) - [not_empty_string](#not_empty_string-source) - [cardinality_equality](#cardinality_equality-source) - - [unique_where](#unique_where-source) - - [not_null_where](#not_null_where-source) - [not_null_proportion](#not_null_proportion-source) - [not_accepted_values](#not_accepted_values-source) - [relationships_where](#relationships_where-source) @@ -300,45 +298,6 @@ models: to: ref('other_model_name') ``` -#### unique_where ([source](macros/generic_tests/test_unique_where.sql)) - -Asserts that there are no duplicate values present in a field for a subset of rows by specifying a `where` clause. - -*Warning*: This test is no longer supported. Starting in dbt v0.20.0, the built-in `unique` test supports a `where` config. [See the dbt docs for more details](https://docs.getdbt.com/reference/resource-configs/where). - -**Usage:** - -```yaml -version: 2 - -models: - - name: my_model - columns: - - name: id - tests: - - dbt_utils.unique_where: - where: "_deleted = false" -``` - -#### not_null_where ([source](macros/generic_tests/test_not_null_where.sql)) - -Asserts that there are no null values present in a column for a subset of rows by specifying a `where` clause. - -*Warning*: This test is no longer supported. Starting in dbt v0.20.0, the built-in `not_null` test supports a `where` config. [See the dbt docs for more details](https://docs.getdbt.com/reference/resource-configs/where). - -**Usage:** - -```yaml -version: 2 - -models: - - name: my_model - columns: - - name: id - tests: - - dbt_utils.not_null_where: - where: "_deleted = false" -``` #### not_null_proportion ([source](macros/generic_tests/not_null_proportion.sql)) diff --git a/integration_tests/data/schema_tests/data_test_not_null_where.csv b/integration_tests/data/schema_tests/data_test_not_null_where.csv deleted file mode 100644 index b7c914c3..00000000 --- a/integration_tests/data/schema_tests/data_test_not_null_where.csv +++ /dev/null @@ -1,5 +0,0 @@ -id,_deleted -1,false -2,false - ,true -3,false \ No newline at end of file diff --git a/integration_tests/data/schema_tests/data_test_unique_where.csv b/integration_tests/data/schema_tests/data_test_unique_where.csv deleted file mode 100644 index 89e4ca8c..00000000 --- a/integration_tests/data/schema_tests/data_test_unique_where.csv +++ /dev/null @@ -1,5 +0,0 @@ -id,_deleted -1,false -2,false -2,true -3,true \ No newline at end of file diff --git a/integration_tests/models/generic_tests/schema.yml b/integration_tests/models/generic_tests/schema.yml index 8dc510dc..1b0f7726 100644 --- a/integration_tests/models/generic_tests/schema.yml +++ b/integration_tests/models/generic_tests/schema.yml @@ -43,20 +43,6 @@ seeds: field: is_active to: ref('data_people') - - name: data_test_unique_where - columns: - - name: id - tests: - - dbt_utils.unique_where: - where: "_deleted = false" - - - name: data_test_not_null_where - columns: - - name: id - tests: - - dbt_utils.not_null_where: - where: "_deleted = false" - - name: data_test_not_accepted_values columns: - name: city diff --git a/macros/generic_tests/test_not_null_where.sql b/macros/generic_tests/test_not_null_where.sql deleted file mode 100644 index d5dbf6c5..00000000 --- a/macros/generic_tests/test_not_null_where.sql +++ /dev/null @@ -1,12 +0,0 @@ -{% test not_null_where(model, column_name) %} - {%- set deprecation_warning = ' - Warning: `dbt_utils.not_null_where` is no longer supported. - Starting in dbt v0.20.0, the built-in `not_null` test supports a `where` config. - ' -%} - {%- do exceptions.warn(deprecation_warning) -%} - {{ return(adapter.dispatch('test_not_null_where', 'dbt_utils')(model, column_name)) }} -{% endtest %} - -{% macro default__test_not_null_where(model, column_name) %} - {{ return(test_not_null(model, column_name)) }} -{% endmacro %} diff --git a/macros/generic_tests/test_unique_where.sql b/macros/generic_tests/test_unique_where.sql deleted file mode 100644 index e752d7b2..00000000 --- a/macros/generic_tests/test_unique_where.sql +++ /dev/null @@ -1,12 +0,0 @@ -{% test unique_where(model, column_name) %} - {%- set deprecation_warning = ' - Warning: `dbt_utils.unique_where` is no longer supported. - Starting in dbt v0.20.0, the built-in `unique` test supports a `where` config. - ' -%} - {%- do exceptions.warn(deprecation_warning) -%} - {{ return(adapter.dispatch('test_unique_where', 'dbt_utils')(model, column_name)) }} -{% endtest %} - -{% macro default__test_unique_where(model, column_name) %} - {{ return(test_unique(model, column_name)) }} -{% endmacro %}