Skip to content

Commit 7acc8c0

Browse files
authored
Restore CI test for case-sensitive identifiers when generating sources (#192)
* Restore case sensitivity test * Try to make integration test adapter-agnostic * Try to make integration test CI-agnostic and adapter-agnostic * Use adapter-agnostic data types * Temporarily hard-code case-insensitive seed name for Snowflake * Temporarily hard-code case-insensitive seed name for Snowflake
1 parent e532bd4 commit 7acc8c0

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

integration_tests/dbt_project.yml

+4
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ flags:
2222
seeds:
2323
+schema: raw_data
2424
+quote_columns: false
25+
codegen_integration_tests:
26+
data__Case_Sensitive:
27+
+schema: Raw_Data_Case_Sensitive
28+
quote_columns: true
2529

2630
vars:
2731
my_table_reference: table_c
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Col_A,Col_B
2+
1,a
3+
2,b
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
2+
{% set raw_schema = generate_schema_name('Raw_Data_Case_Sensitive') %}
3+
4+
-- test default args
5+
{% set actual_source_yaml = codegen.generate_source(
6+
schema_name=raw_schema,
7+
database_name=target.database,
8+
generate_columns=True,
9+
name=raw_schema,
10+
include_database=True,
11+
include_schema=True,
12+
case_sensitive_databases=True,
13+
case_sensitive_schemas=True,
14+
case_sensitive_tables=True,
15+
case_sensitive_cols=True
16+
) %}
17+
18+
{% set expected_source_yaml %}
19+
version: 2
20+
21+
sources:
22+
- name: {{ raw_schema | lower }}
23+
database: {{ target.database }}
24+
schema: {{ raw_schema }}
25+
tables:
26+
- name: {% if target.type == "snowflake" %}DATA__CASE_SENSITIVE{% else %}data__Case_Sensitive{% endif %}
27+
columns:
28+
- name: Col_A
29+
data_type: {{ integer_type_value() }}
30+
- name: Col_B
31+
data_type: {{ text_type_value() }}
32+
{% endset %}
33+
34+
35+
{{ assert_equal (actual_source_yaml | trim, expected_source_yaml | trim) }}

0 commit comments

Comments
 (0)