From 3372908c8c54924b9f4f504271073032be9a53dd Mon Sep 17 00:00:00 2001 From: James McNeill Date: Thu, 31 Mar 2022 07:17:50 +0100 Subject: [PATCH] patch default behaviour in get_column_values --- macros/sql/get_column_values.sql | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/macros/sql/get_column_values.sql b/macros/sql/get_column_values.sql index 57b150a6..b5ec7600 100644 --- a/macros/sql/get_column_values.sql +++ b/macros/sql/get_column_values.sql @@ -3,11 +3,9 @@ {% endmacro %} {% macro default__get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none) -%} -{% if default is none %} - {% set default = [] %} -{% endif %} {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #} {%- if not execute -%} + {% set default = [] if not default %} {{ return(default) }} {% endif %}