From 982c5ce10aae1e17df80e567de16f830b033222b Mon Sep 17 00:00:00 2001 From: Ofek Weiss Date: Wed, 9 Oct 2024 10:07:33 +0300 Subject: [PATCH] handle case where column name is an empty string --- .../macros/base_queries/current_tests_run_results_query.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elementary/monitor/dbt_project/macros/base_queries/current_tests_run_results_query.sql b/elementary/monitor/dbt_project/macros/base_queries/current_tests_run_results_query.sql index 894a53da1..1d15c6a58 100644 --- a/elementary/monitor/dbt_project/macros/base_queries/current_tests_run_results_query.sql +++ b/elementary/monitor/dbt_project/macros/base_queries/current_tests_run_results_query.sql @@ -49,7 +49,7 @@ when elementary_test_results.test_type = 'schema_change' then elementary_test_results.test_unique_id {# In old versions of elementary, elementary_test_results doesn't contain test_short_name, so we use dbt_test short_name. #} when dbt_tests.short_name = 'dimension_anomalies' then elementary_test_results.test_unique_id - else coalesce(elementary_test_results.test_unique_id, 'None') || '.' || coalesce(elementary_test_results.column_name, 'None') || '.' || coalesce(elementary_test_results.test_sub_type, 'None') + else coalesce(elementary_test_results.test_unique_id, 'None') || '.' || coalesce(nullif(elementary_test_results.column_name, ''), 'None') || '.' || coalesce(elementary_test_results.test_sub_type, 'None') end as elementary_unique_id, elementary_test_results.invocation_id, elementary_test_results.data_issue_id,