Skip to content

Commit

Permalink
Array macros (#257)
Browse files Browse the repository at this point in the history
* Temporary dev-requirements

* Changelog entry

* Implementations and tests for array macros

* Restore original dev-requirements.txt
  • Loading branch information
dbeatty10 authored Sep 26, 2022
1 parent dbcb1cf commit a5303e4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .changes/unreleased/Features-20220913-084758.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
kind: Features
body: Array macros
time: 2022-09-13T08:47:58.706618-06:00
custom:
Author: graciegoheen dbeatty10
Issue: "255"
PR: "257"
3 changes: 3 additions & 0 deletions dbt/include/snowflake/macros/utils/array_construct.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% macro snowflake__array_construct(inputs, data_type) -%}
array_construct( {{ inputs|join(' , ') }} )
{%- endmacro %}
17 changes: 16 additions & 1 deletion tests/functional/adapter/utils/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import pytest
from dbt.tests.adapter.utils.base_utils import BaseUtils

from dbt.tests.adapter.utils.test_array_append import BaseArrayAppend
from dbt.tests.adapter.utils.test_array_concat import BaseArrayConcat
from dbt.tests.adapter.utils.test_array_construct import BaseArrayConstruct
from dbt.tests.adapter.utils.test_any_value import BaseAnyValue
from dbt.tests.adapter.utils.test_bool_or import BaseBoolOr
from dbt.tests.adapter.utils.test_cast_bool_to_text import BaseCastBoolToText
Expand Down Expand Up @@ -28,6 +31,18 @@ class TestAnyValue(BaseAnyValue):
pass


class TestArrayAppend(BaseArrayAppend):
pass


class TestArrayConcat(BaseArrayConcat):
pass


class TestArrayConstruct(BaseArrayConstruct):
pass


class TestBoolOr(BaseBoolOr):
pass

Expand Down

0 comments on commit a5303e4

Please sign in to comment.