Skip to content

Commit 73fe78c

Browse files
Merge pull request #881 from kokorin/patch-1
Raize error if columns can't be detected
2 parents 68b0ffc + fa2737e commit 73fe78c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

macros/edr/data_monitoring/schema_changes/get_columns_snapshot_query.sql

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414

1515
{% set columns = adapter.get_columns_in_relation(model_relation) %}
1616

17+
{% if not columns %}
18+
{% set no_columns_error -%}
19+
Failed to detect columns for {{ model_relation }}. Ensure it exists and authorized.
20+
{%- endset %}
21+
exceptions.raise_compiler_error(no_columns_error)
22+
{% endif %}
23+
1724
with table_info as (
1825
select
1926
{{ elementary.edr_cast_as_string(elementary.edr_quote(full_table_name)) }} as full_table_name,
@@ -91,4 +98,4 @@
9198
{{ elementary.edr_cast_as_timestamp('detected_at') }} as detected_at
9299
from columns_snapshot_with_id
93100

94-
{%- endmacro %}
101+
{%- endmacro %}

0 commit comments

Comments
 (0)