From 1e2cf13a72e247226c8f9b1cedac9bf3bdb675e4 Mon Sep 17 00:00:00 2001 From: Michelle Ark Date: Mon, 4 Dec 2023 16:12:29 +0900 Subject: [PATCH] first pass --- dev-requirements.txt | 6 ++-- .../unit_testing/test_unit_testing_types.py | 31 +++++++++++++++++++ 2 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 tests/functional/adapter/unit_testing/test_unit_testing_types.py diff --git a/dev-requirements.txt b/dev-requirements.txt index 9d68fbed7..3700f3f4d 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,8 +1,8 @@ # install latest changes in dbt-core + dbt-postgres # TODO: how to switch from HEAD to x.y.latest branches after minor releases? -git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-core&subdirectory=core -git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-tests-adapter&subdirectory=tests/adapter -git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-postgres&subdirectory=plugins/postgres +git+https://github.com/dbt-labs/dbt-core.git@support-complex-types-unit-testing#egg=dbt-core&subdirectory=core +git+https://github.com/dbt-labs/dbt-core.git@support-complex-types-unit-testing#egg=dbt-tests-adapter&subdirectory=tests/adapter +git+https://github.com/dbt-labs/dbt-core.git@support-complex-types-unit-testing#egg=dbt-postgres&subdirectory=plugins/postgres # if version 1.x or greater -> pin to major version # if version 0.x -> pin to minor diff --git a/tests/functional/adapter/unit_testing/test_unit_testing_types.py b/tests/functional/adapter/unit_testing/test_unit_testing_types.py new file mode 100644 index 000000000..500de0b50 --- /dev/null +++ b/tests/functional/adapter/unit_testing/test_unit_testing_types.py @@ -0,0 +1,31 @@ +import pytest +from dbt.tests.adapter.unit_testing.test_unit_testing_types import BaseUnitTestingTypes + + +class TestRedshiftUnitTestingTypes(BaseUnitTestingTypes): + @pytest.fixture + def data_types(self): + # sql_value, yaml_value + return [ + ["1", "1"], + ["1.0", "1.0"], + ["'1'", "1"], + ["'1'::numeric", "1"], + # ["'string'", "string"], + # ["true", "true"], + # ["DATE '2020-01-02'", "2020-01-02"], + # ["TIMESTAMP '2013-11-03 00:00:00-0'", "2013-11-03 00:00:00-0"], + # ["TIMESTAMPTZ '2013-11-03 00:00:00-0'", "2013-11-03 00:00:00-0"], + # ["ARRAY[1,2,3]", """'{1, 2, 3}'"""], + # ["ARRAY[1.0,2.0,3.0]", """'{1.0, 2.0, 3.0}'"""], + # ["ARRAY[1::numeric,2::numeric,3::numeric]", """'{1.0, 2.0, 3.0}'"""], + # ["ARRAY['a','b','c']", """'{"a", "b", "c"}'"""], + # ["ARRAY[true,true,false]", """'{true, true, false}'"""], + # ["ARRAY[DATE '2020-01-02']", """'{"2020-01-02"}'"""], + # ["ARRAY[TIMESTAMP '2013-11-03 00:00:00-0']", """'{"2013-11-03 00:00:00-0"}'"""], + # ["ARRAY[TIMESTAMPTZ '2013-11-03 00:00:00-0']", """'{"2013-11-03 00:00:00-0"}'"""], + # [ + # """'{"bar": "baz", "balance": 7.77, "active": false}'::json""", + # """'{"bar": "baz", "balance": 7.77, "active": false}'""", + # ], + ]