From d1225fd469ce11a69a8c4ac83df9eed9d04c9719 Mon Sep 17 00:00:00 2001 From: i-125 <> Date: Wed, 25 Dec 2024 12:48:02 +0900 Subject: [PATCH] fix: return 0 in equal_rowcount when both models have zero rows --- macros/generic_tests/equal_rowcount.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macros/generic_tests/equal_rowcount.sql b/macros/generic_tests/equal_rowcount.sql index 600eae23..1db18735 100644 --- a/macros/generic_tests/equal_rowcount.sql +++ b/macros/generic_tests/equal_rowcount.sql @@ -5,7 +5,7 @@ {% macro default__test_equal_rowcount(model, compare_model, group_by_columns) %} {#-- Needs to be set at parse time, before we return '' below --#} -{{ config(fail_calc = 'sum(coalesce(diff_count, 0))') }} +{{ config(fail_calc = 'coalesce(sum(diff_count), 0)') }} {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #} {%- if not execute -%}