From a1e0f07d661a89e924c3dedf4a0bb0b0c18dcf8d Mon Sep 17 00:00:00 2001 From: Elon Gliksberg Date: Wed, 27 Sep 2023 17:08:30 +0300 Subject: [PATCH] Using Jinja to formulate string data type. --- integration_tests/tests/test_schema_changes.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/integration_tests/tests/test_schema_changes.py b/integration_tests/tests/test_schema_changes.py index bb3d745b4..9a47129bd 100644 --- a/integration_tests/tests/test_schema_changes.py +++ b/integration_tests/tests/test_schema_changes.py @@ -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() @@ -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,