Skip to content

Commit

Permalink
fixed capitalization issue for snowflake
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin committed Jan 3, 2024
1 parent 89d0789 commit 2056d20
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ target/
dbt_packages/
logs/
dbt-env/
integration_tests/seeds/*.yml

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@

{% set new_dbt_config = {resource_type: [{"name": table_relation.identifier, "columns": column_tests}]} %}

{{ print(new_dbt_config) }}
{# {{ print(new_dbt_config) }} #}

{% set merged_dbt_config = testgen.merge_dbt_configs(dbt_config, new_dbt_config) %}

Expand Down
8 changes: 6 additions & 2 deletions macros/test_generation/get_uniqueness_test_suggestions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,20 @@
{% endset %}

{% set count_sql %}
{{ "SELECT count(1) AS table_count FROM " ~ table_relation }}
{{ "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].TABLE_COUNT %}

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

{# {{ print(table_count) }}
{{ print(cardinality_results|list) }} #}

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

0 comments on commit 2056d20

Please sign in to comment.