Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore CI test for case-sensitive identifiers when generating sources #192

Merged
merged 6 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ flags:
seeds:
+schema: raw_data
+quote_columns: false
codegen_integration_tests:
data__Case_Sensitive:
+schema: Raw_Data_Case_Sensitive
quote_columns: true

vars:
my_table_reference: table_c
Expand Down
3 changes: 3 additions & 0 deletions integration_tests/seeds/data__Case_Sensitive.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Col_A,Col_B
1,a
2,b
35 changes: 35 additions & 0 deletions integration_tests/tests/test_generate_source_case_sensitive.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@

{% set raw_schema = generate_schema_name('Raw_Data_Case_Sensitive') %}

-- test default args
{% set actual_source_yaml = codegen.generate_source(
schema_name=raw_schema,
database_name=target.database,
generate_columns=True,
name=raw_schema,
include_database=True,
include_schema=True,
case_sensitive_databases=True,
case_sensitive_schemas=True,
case_sensitive_tables=True,
case_sensitive_cols=True
) %}

{% set expected_source_yaml %}
version: 2

sources:
- name: {{ raw_schema | lower }}
database: {{ target.database }}
schema: {{ raw_schema }}
tables:
- name: {% if target.type == "snowflake" %}DATA__CASE_SENSITIVE{% else %}data__Case_Sensitive{% endif %}
columns:
- name: Col_A
data_type: {{ integer_type_value() }}
- name: Col_B
data_type: {{ text_type_value() }}
{% endset %}


{{ assert_equal (actual_source_yaml | trim, expected_source_yaml | trim) }}
Loading