Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Commit b7bb0bc

Browse files
authored
Cross-database date macro (#1219)
* Cross-database `date` macro * Temporary dev requirements for testing * Update changelog entry * Revert "Temporary dev requirements for testing" This reverts commit b46183a.
1 parent d148cc3 commit b7bb0bc

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
kind: Features
2+
body: Cross-database `date` macro
3+
time: 2024-05-01T15:19:02.929676-06:00
4+
custom:
5+
Author: dbeatty10
6+
Issue: 1221
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{% macro bigquery__date(year, month, day) -%}
2+
date({{ year }}, {{ month }}, {{ day }})
3+
{%- endmacro %}

tests/functional/adapter/utils/test_utils.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from dbt.tests.adapter.utils.test_cast_bool_to_text import BaseCastBoolToText
1212
from dbt.tests.adapter.utils.test_concat import BaseConcat
1313
from dbt.tests.adapter.utils.test_current_timestamp import BaseCurrentTimestampAware
14+
from dbt.tests.adapter.utils.test_date import BaseDate
1415
from dbt.tests.adapter.utils.test_dateadd import BaseDateAdd
1516
from dbt.tests.adapter.utils.test_datediff import BaseDateDiff
1617
from dbt.tests.adapter.utils.test_date_spine import BaseDateSpine
@@ -117,6 +118,10 @@ class TestCurrentTimestamp(BaseCurrentTimestampAware):
117118
pass
118119

119120

121+
class TestDate(BaseDate):
122+
pass
123+
124+
120125
class TestDateAdd(BaseDateAdd):
121126
pass
122127

0 commit comments

Comments
 (0)