Skip to content

Commit

Permalink
fixed capitalization issue for postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin committed Jan 3, 2024
1 parent 2056d20 commit 1472995
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@
{# {{ print(cardinality_result.COLNAME) }} #}

{% set col_config = {
"name": cardinality_result.COLNAME,
"name": cardinality_result[1],
"description": "Accepted values test generated by dbt-testgen",
"tests": [
{"accepted_values": {"values": fromjson(cardinality_result.UNIQUE_VALUES)|sort}}
{"accepted_values": {"values": fromjson(cardinality_result[3])|sort}}
]
}
%}
Expand Down
6 changes: 3 additions & 3 deletions macros/test_generation/get_range_test_suggestions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@
{% set column_tests = [] %}
{% for result in results %}
{% set col_config = {
"name": result.COLNAME,
"name": result[0],
"description": "Numeric range test generated by dbt-testgen",
"tests": [
{
"dbt_utils.accepted_range": {
"min_value": result.COL_MIN,
"max_value": result.COL_MAX
"min_value": result[1],
"max_value": result[2]
}
}
]
Expand Down
4 changes: 2 additions & 2 deletions macros/test_generation/get_uniqueness_test_suggestions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
{{ "SELECT count(1) AS TABLE_COUNT FROM " ~ table_relation }}
{% endset%}

{% set table_count = testgen.query_as_list(count_sql)[0].TABLE_COUNT %}
{% set table_count = testgen.query_as_list(count_sql)[0][0] %}

{% set cardinality_results = zip(column_combinations, testgen.query_as_list(count_distinct_sql)) %}

Expand All @@ -109,7 +109,7 @@

{% set unique_keys = [] %}
{% for cardinality_result in cardinality_results %}
{% if cardinality_result[1].CARDINALITY == table_count %}
{% if cardinality_result[1][1] == table_count %}
{# {{ print(cardinality_result) }} #}
{% do unique_keys.append(cardinality_result[0]) %}
{% endif %}
Expand Down

0 comments on commit 1472995

Please sign in to comment.