Skip to content

Commit

Permalink
Make string field types more explicit (#132)
Browse files Browse the repository at this point in the history
* Make string field types more explicit

* Update CHANGELOG
  • Loading branch information
clausherther authored Dec 8, 2021
1 parent ce3a4ed commit 82e9ba5
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 8 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# dbt-expectations v0.5.1

## Fixes
* Add better support for Redshift by typing implicit `varchar` fields explicitly to strings. ([#131](https://github.com/calogica/dbt-expectations/pull/131) [#132](https://github.com/calogica/dbt-expectations/pull/132))


# dbt-expectations v0.5.0
* adds full support for dbt 1.x without backwards compatability
* supports `dbt-date 0.5.0`, which supports `dbt-utils 0.8.0`

# dbt-expectations v0.4.7
* Patch: adds support for dbt 1.x

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ set_values as (
{% for value in value_set -%}
select
{% if quote_values -%}
'{{ value }}'
cast('{{ value }}' as {{ dbt_utils.type_string() }})
{%- else -%}
{{ value }}
{%- endif %} as value_field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ set_values as (
{% for value in value_set -%}
select
{% if quote_values -%}
'{{ value }}'
cast('{{ value }}' as {{ dbt_utils.type_string() }})
{%- else -%}
{{ value }}
{%- endif %} as value_field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{% else %}
{{ exceptions.raise_compiler_error(
"`value_pairs_set` argument for expect_column_pair_values_to_be_in_set test cannot have more than 2 item per element.
Got: '" ~ pair ~"'.'"
Got: '" ~ pair ~ "'.'"
) }}
{% endif %}
{% endfor %}
Expand Down
2 changes: 1 addition & 1 deletion macros/schema_tests/table_shape/expect_column_to_exist.sql
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
with test_data as (

select
'{{ column_name }}' as column_name,
cast('{{ column_name }}' as {{ dbt_utils.type_string() }}) as column_name,
{{ matching_column_index }} as matching_column_index,
{{ column_index_matches }} as column_index_matches

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
with relation_columns as (

{% for col_name in relation_column_names %}
select '{{ col_name }}' as relation_column
select cast('{{ col_name }}' as {{ dbt_utils.type_string() }}) as relation_column
{% if not loop.last %}union all{% endif %}
{% endfor %}
),
input_columns as (

{% for col_name in column_list %}
select '{{ col_name }}' as input_column
select cast('{{ col_name }}' as {{ dbt_utils.type_string() }}) as input_column
{% if not loop.last %}union all{% endif %}
{% endfor %}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
with relation_columns as (

{% for col_name in relation_column_names %}
select '{{ col_name }}' as relation_column
select cast('{{ col_name }}' as {{ dbt_utils.type_string() }}) as relation_column
{% if not loop.last %}union all{% endif %}
{% endfor %}
),
input_columns as (

{% for col_name in column_list %}
select '{{ col_name }}' as input_column
select cast('{{ col_name }}' as {{ dbt_utils.type_string() }}) as input_column
{% if not loop.last %}union all{% endif %}
{% endfor %}
)
Expand Down

0 comments on commit 82e9ba5

Please sign in to comment.