Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Array macros #257

Merged
merged 8 commits into from
Sep 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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