From 868a447c587d0c66a0555519e569fc93c5410d11 Mon Sep 17 00:00:00 2001 From: Mikael Ene Date: Thu, 7 May 2020 07:38:21 +0200 Subject: [PATCH] alias for schema tests macros --- .../global_project/macros/schema_tests/accepted_values.sql | 2 +- .../dbt/include/global_project/macros/schema_tests/not_null.sql | 2 +- .../global_project/macros/schema_tests/relationships.sql | 2 +- core/dbt/include/global_project/macros/schema_tests/unique.sql | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/dbt/include/global_project/macros/schema_tests/accepted_values.sql b/core/dbt/include/global_project/macros/schema_tests/accepted_values.sql index b9102a85cd1..6dfd43d5cbc 100644 --- a/core/dbt/include/global_project/macros/schema_tests/accepted_values.sql +++ b/core/dbt/include/global_project/macros/schema_tests/accepted_values.sql @@ -31,7 +31,7 @@ validation_errors as ( ) ) -select count(*) +select count(*) as validation_errors from validation_errors {% endmacro %} diff --git a/core/dbt/include/global_project/macros/schema_tests/not_null.sql b/core/dbt/include/global_project/macros/schema_tests/not_null.sql index 83bf2c28bea..2a6dac26da6 100644 --- a/core/dbt/include/global_project/macros/schema_tests/not_null.sql +++ b/core/dbt/include/global_project/macros/schema_tests/not_null.sql @@ -3,7 +3,7 @@ {% set column_name = kwargs.get('column_name', kwargs.get('arg')) %} -select count(*) +select count(*) as validation_errors from {{ model }} where {{ column_name }} is null diff --git a/core/dbt/include/global_project/macros/schema_tests/relationships.sql b/core/dbt/include/global_project/macros/schema_tests/relationships.sql index a7c1085fc13..cd9a820cc1d 100644 --- a/core/dbt/include/global_project/macros/schema_tests/relationships.sql +++ b/core/dbt/include/global_project/macros/schema_tests/relationships.sql @@ -4,7 +4,7 @@ {% set column_name = kwargs.get('column_name', kwargs.get('from')) %} -select count(*) +select count(*) as validation_errors from ( select {{ column_name }} as id from {{ model }} ) as child diff --git a/core/dbt/include/global_project/macros/schema_tests/unique.sql b/core/dbt/include/global_project/macros/schema_tests/unique.sql index 7085c44a7d9..74d63e3d5f9 100644 --- a/core/dbt/include/global_project/macros/schema_tests/unique.sql +++ b/core/dbt/include/global_project/macros/schema_tests/unique.sql @@ -3,7 +3,7 @@ {% set column_name = kwargs.get('column_name', kwargs.get('arg')) %} -select count(*) +select count(*) as validation_errors from ( select