Skip to content

Commit

Permalink
consolidate timestamp logic (#5979) (#5986)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

* Update plugins/postgres/dbt/include/postgres/macros/timestamps.sql

Co-authored-by: Doug Beatty <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>
(cherry picked from commit 50fe25d)

Co-authored-by: colin-rogers-dbt <[email protected]>
  • Loading branch information
github-actions[bot] and colin-rogers-dbt authored Oct 3, 2022
1 parent 6042469 commit fc45a51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .changes/unreleased/Features-20220914-095625.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit fc45a51

Please sign in to comment.