diff --git a/macros/sql/get_column_values.sql b/macros/sql/get_column_values.sql index d1dcf5d4..3aa84c03 100644 --- a/macros/sql/get_column_values.sql +++ b/macros/sql/get_column_values.sql @@ -13,8 +13,11 @@ {# Not all relations are tables. Renaming for internal clarity without breaking functionality for anyone using named arguments #} {# TODO: Change the method signature in a future 0.x.0 release #} - {%- set target_relation = table -%} - + {%- set target_relation = table -%} + {% if table is string %} + {{ log("target_relation" ~ target_relation ~ "is not in the valid database.schema.table format. Returning the default value: " ~ default, info=True) }} + {{ return(default) }} + {% endif %} {# adapter.load_relation is a convenience wrapper to avoid building a Relation when we already have one #} {% set relation_exists = (load_relation(target_relation)) is not none %}