From e01eddf23949390ab0002408758f328a081494da Mon Sep 17 00:00:00 2001 From: ptiurin Date: Mon, 2 Sep 2024 15:41:04 +0100 Subject: [PATCH] test: Fix 1.0 test with quoting --- .../adapter/unit_testing/test_unit_testing.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/functional/adapter/unit_testing/test_unit_testing.py b/tests/functional/adapter/unit_testing/test_unit_testing.py index ba3a2520..a08abfab 100644 --- a/tests/functional/adapter/unit_testing/test_unit_testing.py +++ b/tests/functional/adapter/unit_testing/test_unit_testing.py @@ -1,3 +1,5 @@ +import os + from dbt.tests.adapter.unit_testing.test_case_insensitivity import ( BaseUnitTestCaseInsensivity, ) @@ -20,7 +22,7 @@ class TestFireboltUnitTestingTypes(BaseUnitTestingTypes): @fixture def data_types(self): # sql_value, yaml_value - return [ + d_types = [ ['1', '1'], ["'1'", '1'], ['true', 'true'], @@ -32,6 +34,13 @@ def data_types(self): """'{"bar": "baz", "balance": 7.77, "active": false}'""", # json """'{"bar": "baz", "balance": 7.77, "active": false}'""", ], - ["ARRAY['a','b','c']", """'{"a", "b", "c"}'"""], ['ARRAY[1,2,3]', """'{1, 2, 3}'"""], ] + # Firebolt 2.0 supports casting with double quotes, but not 1.0 + if bool(os.getenv('PASSWORD')): + # 1.0 + d_types.append(["ARRAY['a','b','c']", """'{''a'', ''b'', ''c''}'"""]) + else: + # 2.0 + d_types.append(["ARRAY['a','b','c']", """'{"a", "b", "c"}'"""]) + return d_types