Skip to content

Commit

Permalink
add utils.cast
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelleArk committed Feb 1, 2024
1 parent 632dec7 commit 5a50be7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions dbt/include/global_project/macros/utils/cast.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{% macro cast(field, type) %}
{{ return(adapter.dispatch('cast', 'dbt') (field, type)) }}
{% endmacro %}

{% macro default__cast(field, type) %}
cast({{field}} as {{type}})
{% endmacro %}
2 changes: 1 addition & 1 deletion dbt/tests/adapter/unit_testing/test_unit_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,5 @@ def test_unit_test_data_type(self, project, data_types):
raise AssertionError(f"unit test failed when testing model with {sql_value}")


class TestUnitTestingTypes(BaseUnitTestingTypes):
class TestPostgresUnitTestingTypes(BaseUnitTestingTypes):
pass

0 comments on commit 5a50be7

Please sign in to comment.