Skip to content

Commit

Permalink
Completely rely on vendored version of the format_column macro
Browse files Browse the repository at this point in the history
  • Loading branch information
dbeatty10 committed Sep 25, 2023
1 parent 5e08a1a commit b2f463c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
7 changes: 1 addition & 6 deletions macros/generate_model_yaml.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@

{% do model_yaml.append(' - name: ' ~ column_name | lower ) %}
{% if include_data_types %}
{% set version = (dbt_version.split('.')[0] ~ '.' ~ dbt_version.split('.')[1]) | float %}
{% if version < 1.5 %}
{% set formatted = format_column(column) %}
{% else %}
{% set formatted = adapter.dispatch('format_column', 'dbt')(column) %}
{% endif %}
{% set formatted = format_column(column) %}
{% do model_yaml.append(' data_type: ' ~ formatted['data_type'] | lower) %}
{% endif %}
{% do model_yaml.append(' description: "' ~ column_desc_dict.get(column.name | lower,'') ~ '"') %}
Expand Down
7 changes: 1 addition & 6 deletions macros/generate_source.sql
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,7 @@
{% for column in columns %}
{% do sources_yaml.append(' - name: ' ~ column.name | lower ) %}
{% if include_data_types %}
{% set version = (dbt_version.split('.')[0] ~ '.' ~ dbt_version.split('.')[1]) | float %}
{% if version < 1.5 %}
{% set formatted = format_column(column) %}
{% else %}
{% set formatted = adapter.dispatch('format_column', 'dbt')(column) %}
{% endif %}
{% set formatted = format_column(column) %}
{% do sources_yaml.append(' data_type: ' ~ formatted['data_type'] | lower) %}
{% endif %}
{% if include_descriptions %}
Expand Down

0 comments on commit b2f463c

Please sign in to comment.