Skip to content

Commit

Permalink
exceptions.column_type_missing when data_type missing in bigquery__ge…
Browse files Browse the repository at this point in the history
…t_empty_schema_sql on flattened columns representation
  • Loading branch information
MichelleArk committed Jul 10, 2023
1 parent fb9210d commit 2ab4fef
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions dbt/include/bigquery/macros/utils/get_columns_spec_ddl.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@
{%- endmacro -%}

{% macro bigquery__get_empty_schema_sql(columns) %}
{%- set col_err = [] -%}
{% for col in columns.values() %}
{%- if col['data_type'] is not defined -%}
{{ col_err.append(col['name']) }}
{%- endif -%}
{%- endfor -%}
{%- if (col_err | length) > 0 -%}
{{ exceptions.column_type_missing(column_names=col_err) }}
{%- endif -%}

{%- set columns = adapter.nest_column_data_types(columns) -%}
{{ return(dbt.default__get_empty_schema_sql(columns)) }}
{% endmacro %}
Expand Down

0 comments on commit 2ab4fef

Please sign in to comment.