Skip to content

Commit

Permalink
Using Jinja to formulate string data type.
Browse files Browse the repository at this point in the history
  • Loading branch information
elongl committed Sep 27, 2023
1 parent bdc18a6 commit a1e0f07
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions integration_tests/tests/test_schema_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
("name", "column_removed"),
]

STRING_JINJA = r"{{ 'STRING' if (target.type == 'bigquery' or target.type == 'databricks') else 'character varying' if target.type == 'redshift' else 'TEXT' }}"


def assert_test_results(test_results: List[dict]):
expected_failures = EXPECTED_FAILURES.copy()
Expand Down Expand Up @@ -61,8 +63,8 @@ def test_schema_changes_from_baseline(test_id: str, dbt_project: DbtProject):
test_args={"fail_on_added": True, "enforce_types": True},
columns=[
{"name": "id", "data_type": "integer"},
{"name": "name", "data_type": "string"},
{"name": "nick", "data_type": "string"},
{"name": "name", "data_type": STRING_JINJA},
{"name": "nick", "data_type": STRING_JINJA},
],
data=DATASET2,
multiple_results=True,
Expand Down

0 comments on commit a1e0f07

Please sign in to comment.