From fc45a515829cbf80c7ce4374f4b0f1a614a0491c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 3 Oct 2022 10:50:18 -0400 Subject: [PATCH] consolidate timestamp logic (#5979) (#5986) * Consolidate date macros into dates.sql * rename to timestamps.sql * fix whitespace + add changie * cleanup macros and add testing * fix whitespace * remove now macro * fix functional test * remove local config * make snowflake backwards compat return utc * move timestamps to adaptor base tests * move backcompat macros to respective adapters * change timestamp param to source_timestamp * move timestamps.py to utils * update changie.yaml * make expected schema a fixture * formatting * add debug message to assert * fix changie.yaml * Update tests/adapter/dbt/tests/adapter/utils/test_timestamps.py Co-authored-by: Doug Beatty <44704949+dbeatty10@users.noreply.github.com> * Update plugins/postgres/dbt/include/postgres/macros/timestamps.sql Co-authored-by: Doug Beatty <44704949+dbeatty10@users.noreply.github.com> * Update .changie.yaml * add backcompat utc * remove current_timestamp_in_utc * remove convert_timezone * add _in_utc_backcompat * fix macro_calls typo * add expected sql validation to test_timestamps * make expected_sql optional * improve sql check string comparison test * remove extraneous test file * add timestamp casting back * Update plugins/postgres/dbt/include/postgres/macros/adapters.sql Co-authored-by: Doug Beatty <44704949+dbeatty10@users.noreply.github.com> * add check_relation_has_expected_schema to comments * fix whitespace * remove default impl of current_timestamp * manual changie log fix Co-authored-by: Doug Beatty <44704949+dbeatty10@users.noreply.github.com> (cherry picked from commit 50fe25d2301cadfeb9461cd5e3e547b33262baa1) Co-authored-by: colin-rogers-dbt <111200756+colin-rogers-dbt@users.noreply.github.com> --- .changes/unreleased/Features-20220914-095625.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changes/unreleased/Features-20220914-095625.yaml b/.changes/unreleased/Features-20220914-095625.yaml index 61196532985..51828084a0d 100644 --- a/.changes/unreleased/Features-20220914-095625.yaml +++ b/.changes/unreleased/Features-20220914-095625.yaml @@ -1,5 +1,5 @@ kind: Features -body: Add standard timestamps.sql +body: Migrate dbt-utils current_timestamp macros into core + adapters time: 2022-09-14T09:56:25.97818-07:00 custom: Author: colin-rogers-dbt