From e3c9ba0b7f9bb0031e469d66a4daf7af4a9a4dfb Mon Sep 17 00:00:00 2001 From: Doug Beatty Date: Wed, 1 May 2024 15:41:18 -0600 Subject: [PATCH 1/4] Cross-database `date` macro --- .changes/unreleased/Features-20240501-151901.yaml | 6 ++++++ tests/functional/adapter/utils/test_utils.py | 5 +++++ 2 files changed, 11 insertions(+) create mode 100644 .changes/unreleased/Features-20240501-151901.yaml diff --git a/.changes/unreleased/Features-20240501-151901.yaml b/.changes/unreleased/Features-20240501-151901.yaml new file mode 100644 index 000000000..342cd91ba --- /dev/null +++ b/.changes/unreleased/Features-20240501-151901.yaml @@ -0,0 +1,6 @@ +kind: Features +body: Cross-database `date` macro +time: 2024-05-01T15:19:01.141157-06:00 +custom: + Author: dbeatty10 + Issue: https://github.com/dbt-labs/dbt-core/issues/8831 diff --git a/tests/functional/adapter/utils/test_utils.py b/tests/functional/adapter/utils/test_utils.py index bea418998..a97253f07 100644 --- a/tests/functional/adapter/utils/test_utils.py +++ b/tests/functional/adapter/utils/test_utils.py @@ -6,6 +6,7 @@ from dbt.tests.adapter.utils.test_cast_bool_to_text import BaseCastBoolToText from dbt.tests.adapter.utils.test_concat import BaseConcat from dbt.tests.adapter.utils.test_current_timestamp import BaseCurrentTimestampAware +from dbt.tests.adapter.utils.test_date import BaseDate from dbt.tests.adapter.utils.test_dateadd import BaseDateAdd from dbt.tests.adapter.utils.test_datediff import BaseDateDiff from dbt.tests.adapter.utils.test_date_spine import BaseDateSpine @@ -62,6 +63,10 @@ class TestCurrentTimestamp(BaseCurrentTimestampAware): pass +class TestDate(BaseDate): + pass + + class TestDateAdd(BaseDateAdd): pass From 7c4424dffd80e0dc93c3228bae13773903f58595 Mon Sep 17 00:00:00 2001 From: Doug Beatty Date: Wed, 1 May 2024 15:55:14 -0600 Subject: [PATCH 2/4] Temporary dev requirements for testing --- dev-requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 6f4fd46ae..0ee8abfb3 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,8 +1,8 @@ # 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-adapters.git -git+https://github.com/dbt-labs/dbt-adapters.git#subdirectory=dbt-tests-adapter +git+https://github.com/dbt-labs/dbt-core.git@main#egg=dbt-core&subdirectory=core +git+https://github.com/dbt-labs/dbt-adapters.git@dbeatty/date-macro +git+https://github.com/dbt-labs/dbt-adapters.git@dbeatty/date-macro#subdirectory=dbt-tests-adapter # if version 1.x or greater -> pin to major version # if version 0.x -> pin to minor From 30bef94df9726b1e92d054d2dcdf9a8558d43bcf Mon Sep 17 00:00:00 2001 From: Doug Beatty Date: Thu, 2 May 2024 07:00:56 -0600 Subject: [PATCH 3/4] Update changelog entry --- .changes/unreleased/Features-20240501-151901.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changes/unreleased/Features-20240501-151901.yaml b/.changes/unreleased/Features-20240501-151901.yaml index 342cd91ba..0f792c40e 100644 --- a/.changes/unreleased/Features-20240501-151901.yaml +++ b/.changes/unreleased/Features-20240501-151901.yaml @@ -3,4 +3,4 @@ body: Cross-database `date` macro time: 2024-05-01T15:19:01.141157-06:00 custom: Author: dbeatty10 - Issue: https://github.com/dbt-labs/dbt-core/issues/8831 + Issue: 1013 From f69caea901a88b2d9c7481d6ca99889f568d8086 Mon Sep 17 00:00:00 2001 From: Doug Beatty Date: Thu, 2 May 2024 07:04:28 -0600 Subject: [PATCH 4/4] Revert "Temporary dev requirements for testing" This reverts commit 7c4424dffd80e0dc93c3228bae13773903f58595. --- dev-requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 0ee8abfb3..6f4fd46ae 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,8 +1,8 @@ # 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@main#egg=dbt-core&subdirectory=core -git+https://github.com/dbt-labs/dbt-adapters.git@dbeatty/date-macro -git+https://github.com/dbt-labs/dbt-adapters.git@dbeatty/date-macro#subdirectory=dbt-tests-adapter +git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-core&subdirectory=core +git+https://github.com/dbt-labs/dbt-adapters.git +git+https://github.com/dbt-labs/dbt-adapters.git#subdirectory=dbt-tests-adapter # if version 1.x or greater -> pin to major version # if version 0.x -> pin to minor