Skip to content

Commit

Permalink
first pass: unit test typing
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelleArk committed Nov 21, 2023
1 parent 0c5422c commit c4a3a3d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# install latest changes in dbt-core
# TODO: how to automate switching from develop to version branches?
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@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

# if version 1.x or greater -> pin to major version
# if version 0.x -> pin to minor
Expand Down
19 changes: 19 additions & 0 deletions tests/functional/adapter/unit_testing/test_unit_testing_types.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import pytest
from dbt.tests.adapter.unit_testing.test_unit_testing_types import BaseUnitTestingTypes


class TestBigQueryUnitTestingTypes(BaseUnitTestingTypes):
@pytest.fixture
def data_types(self):
# sql_value, yaml_value
return [
["1", "1"],
["'1'", "1"],
["cast('true' as boolean)", "true"],
["cast('2019-01-01' as date)", "2019-01-01"],
["cast('2013-11-03 00:00:00-07' as TIMESTAMP)", "2013-11-03 00:00:00-07"],
["cast(['a','b','c'] as array<string>)", "['a','b','c']"],
["cast([1,2,3] as array<int>)", "[1,2,3]"],
["cast(1 as NUMERIC)", "1"],
# ["""JSON '{"name": "Cooper", "forname": "Alice"}'""", """'{"name": "Cooper", "forname": "Alice"}'"""], #TODO
]

0 comments on commit c4a3a3d

Please sign in to comment.