-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
3 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
35
integration_tests/tests/test_generate_source_case_sensitive.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) }} |