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

[Feature] Standardize and move all cent conversions to the staging models #100

Open
1 of 4 tasks
fivetran-joemarkiewicz opened this issue Dec 3, 2024 · 1 comment · May be fixed by #101
Open
1 of 4 tasks

[Feature] Standardize and move all cent conversions to the staging models #100

fivetran-joemarkiewicz opened this issue Dec 3, 2024 · 1 comment · May be fixed by #101
Assignees
Labels
good first issue Good for newcomers type:enhancement New functionality or enhancement

Comments

@fivetran-joemarkiewicz
Copy link
Contributor

Is there an existing feature request for this?

  • I have searched the existing issues

Describe the Feature

In a number of our end models we convert the numerical fields from cents to the whole dollar value. This is appropriate as the data from the Stripe source is synced in cents. However, we are not consistent in this conversion throughout the package. Instead we should apply these conversions at the source package level and allow these conversions to persist downstream instead of applying them inconsistently within the end models.

How would you implement this feature?

Apply these conversions at the source package and staging model levels

Describe alternatives you've considered

Apply these conversions within the end models. Not ideal and is the current state.

Are you interested in contributing this feature?

  • Yes.
  • Yes, but I will need assistance.
  • No.

Anything else?

No response

@fivetran-joemarkiewicz fivetran-joemarkiewicz added good first issue Good for newcomers type:enhancement New functionality or enhancement status:scoping Currently being scoped labels Dec 3, 2024
@fivetran-joemarkiewicz
Copy link
Contributor Author

Upon review of this issue the plan should be as follows. Update the below fields within the respective staging models in the dbt_stripe_source package to convert from cents to dollar. The conversion should resemble the following:

Using the amount field within stg_stripe__balance_transactions as the example below

coalesce(amount/100.0, 0) as amount,

From my initial scoping it seems that all amount type fields (eg. amount, fee, charge, refund_amount, net, etc.) will require this conversion out of cents. Please review every staging model and the Stripe ERD to identify all the fields that will require this update.

Once the updates have been made at the staging level, we will need to update any downstream models in this package that convert these values in the end models (such as within stripe__customer_overview). In the end we will expect to have all the conversions out of cents to be performed at the staging model level and all downstream models will not need to apply this conversion.

Please note, this will be considered a breaking change at the source package level. As a result, we will also need to make this package a breaking change to reference the new version of the source package along with the changes for this package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers type:enhancement New functionality or enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants