Skip to content

Commit b1f5271

Browse files
jasnonazJason Ganx
and
Jason Ganx
authored
fix: not_null_proportion test deprecation warning and performance (#416)
* fix to make not-null-proportion work as intended and remove decpration warning; * fix for object type in excluded columns * clean up namespace formatting * fix to make not-null-proportion work as intended and remove decpration warning; * remove utils.star from separate change * remove utils.star from unrelated change Co-authored-by: Jason Ganx <jasonganx@jason-ganx.myfiosgateway.com>
1 parent fbe2167 commit b1f5271

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% macro test_not_null_proportion(model) %}
2-
{{ return(adapter.dispatch('test_not_null_proportion', packages = dbt_utils._get_utils_namespaces())(model, **kwargs)) }}
2+
{{ return(adapter.dispatch('test_not_null_proportion', 'dbt_utils')(model, **kwargs)) }}
33
{% endmacro %}
44

55
{% macro default__test_not_null_proportion(model) %}
@@ -9,7 +9,7 @@
99
{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}
1010

1111
with validation as (
12-
select
12+
select
1313
sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as numeric) as not_null_proportion
1414
from {{ model }}
1515
),
@@ -19,8 +19,8 @@ validation_errors as (
1919
from validation
2020
where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}
2121
)
22-
select
23-
count(*)
22+
select
23+
*
2424
from validation_errors
2525

2626
{% endmacro %}

0 commit comments

Comments
 (0)