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

remove current_timestamp macro #694

Merged
merged 19 commits into from
Oct 4, 2022
Merged
Show file tree
Hide file tree
Changes from 3 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
15 changes: 1 addition & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ Check [dbt Hub](https://hub.getdbt.com/dbt-labs/dbt_utils/latest/) for the lates
- [get_url_path](#get_url_path-source)

- [Cross-database macros](#cross-database-macros):
- [current_timestamp](#current_timestamp-source)
- [dateadd](#dateadd-source)
- [datediff](#datediff-source)
- [split_part](#split_part-source)
Expand Down Expand Up @@ -1162,18 +1161,6 @@ Note that most of these macros moved to dbt Core as of dbt_utils v0.9.0 and dbt
To access the version defined in dbt Core, remove the `dbt_utils.` prefix (see [https://docs.getdbt.com/reference/dbt-jinja-functions/cross-database-macros](https://docs.getdbt.com/reference/dbt-jinja-functions/cross-database-macros) for examples).
As highlighted below, some of the cross-database macros are still in the process of being deprecated.

#### current_timestamp ([source](macros/cross_db_utils/current_timestamp.sql))

*DEPRECATED: This macro is deprecated and will be removed in a future version of the package, once equivalent functionality is implemented in dbt Core.*

This macro returns the current timestamp.

**Usage:**

```
{{ dbt_utils.current_timestamp() }}
```

#### dateadd ([source](macros/cross_db_utils/dateadd.sql))

*DEPRECATED: This macro is now provided in dbt Core. It is no longer available in dbt_utils and backwards compatibility will be removed in a future version of the package.*
Expand Down Expand Up @@ -1477,7 +1464,7 @@ A useful workaround is to change the above post-hook to:
### Reporting bugs and contributing code

- Want to report a bug or request a feature? Let us know in the `#package-ecosystem` channel on [Slack](http://community.getdbt.com/), or open [an issue](https://github.com/dbt-labs/dbt-utils/issues/new)
- Want to help us build dbt-utils? Check out the [Contributing Guide](https://github.com/dbt-utils/dbt-core/blob/HEAD/CONTRIBUTING.md)
- Want to help us build dbt-utils? Check out the [Contributing Guide](https://github.com/dbt-labs/dbt-utils/blob/main/CONTRIBUTING.md)
colin-rogers-dbt marked this conversation as resolved.
Show resolved Hide resolved
- **TL;DR** Open a Pull Request with 1) your changes, 2) updated documentation for the `README.md` file, and 3) a working integration test.

----
Expand Down
6 changes: 0 additions & 6 deletions integration_tests/models/cross_db_utils/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@ models:
actual: actual
expected: expected

- name: test_current_timestamp
tests:
- assert_equal:
actual: actual
expected: expected

- name: test_date_trunc
tests:
- assert_equal:
Expand Down

This file was deleted.

This file was deleted.

12 changes: 0 additions & 12 deletions integration_tests/models/generic_tests/test_recency.sql

This file was deleted.

40 changes: 0 additions & 40 deletions macros/cross_db_utils/current_timestamp.sql

This file was deleted.

2 changes: 1 addition & 1 deletion macros/generic_tests/mutually_exclusive_ranges.sql
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ with window_functions as (

calc as (
-- We want to return records where one of our assumptions fails, so we'll use
-- the `not` function with `and` statements so we can write our assumptions nore cleanly
-- the `not` function with `and` statements so we can write our assumptions more cleanly
select
*,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{{ dateadd('millisecond',
-1,
"nullif('" ~ stop_date ~ "','')::timestamp") }},
{{ dbt_utils.current_timestamp() }}
{{ current_timestamp() }}
) as stop_timestamp
from "{{target_schema}}"."{{target_table}}"
)
Expand Down