-
Notifications
You must be signed in to change notification settings - Fork 2
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
Replace dbt.current_timestamp and support timestamp casting #20
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fivetran-avinash a few questions and change requests before approval.
@@ -17,7 +17,7 @@ with spine as ( | |||
{# If only compiling, creates range going back 1 year #} | |||
{% else %} | |||
{% set calc_first_date = dbt.dateadd("year", "-1", "current_date") %} | |||
{% set calc_last_date = dbt.current_timestamp_backcompat() %} | |||
{% set calc_last_date = dbt.current_timestamp() %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessary for this update - but may as well create a FR to update the if execute
of this date_spine to emulate the flags.which approach we've been taking in recent models.
This update can be applied in the next breaking change, but I'd like to record the need for that now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reminder to open a FR to address this in a future breaking change. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fivetran-joemarkiewicz This is ready for re-review. Let me know if you are still seeing the compilation error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fivetran-avinash thanks for these updates - this looks ready for pre-release!
@@ -17,7 +17,7 @@ with spine as ( | |||
{# If only compiling, creates range going back 1 year #} | |||
{% else %} | |||
{% set calc_first_date = dbt.dateadd("year", "-1", "current_date") %} | |||
{% set calc_last_date = dbt.current_timestamp_backcompat() %} | |||
{% set calc_last_date = dbt.current_timestamp() %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reminder to open a FR to address this in a future breaking change. Thanks!
packages.yml
Outdated
# - package: fivetran/zuora_source | ||
# version: 0.2.2-a1 | ||
- git: https://github.com/fivetran/dbt_zuora_source.git | ||
revision: bugfix/timestamp-casting | ||
warn-unpinned: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reminder to swap before pre-release
cast(subscriptions.subscription_start_date as {{ dbt.type_timestamp() }}) as subscription_period_started_at, | ||
cast(subscriptions.subscription_end_date as {{ dbt.type_timestamp() }}) as subscription_period_ended_at, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks to be resolved in dev! I still see the error in prod, but this may have been an error previously that we're able to address with this change. Thanks!
PR Overview
This PR will address the following Issue/Feature: Internal ticket
This PR will result in the following new package version: v0.3.2
Updating casting macros here.
Please provide the finalized CHANGELOG entry which details the relevant changes included in this PR:
Bug Fixes (originating within the upstream
zuora_source
package):{{ dbt.type_timestamp() }}
macro within staging models for all timestamp fields. Certain Redshift warehouses sync these fields astimestamp with time zone
fields by default, causing errors in thezuora
package. This macro safely removes timezone values from the UTC timestamps and ensures successful compilations of these models.Under the Hood
dbt.current_timestamp_backcompat()
function withdbt.current_timestamp()
to ensure all timestamps are captured in UTC. (#20)Documentation
PR Checklist
Basic Validation
Please acknowledge that you have successfully performed the following commands locally:
Before marking this PR as "ready for review" the following have been applied:
Detailed Validation
Please share any and all of your validation steps:
If you had to summarize this PR in an emoji, which would it be?
⏲️