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

Adapts billing history to invoice grain #8

Merged

Conversation

fivetran-avinash
Copy link
Contributor

@fivetran-avinash fivetran-avinash commented Aug 16, 2023

PR Overview

This PR will address the following Issue/Feature: [#7]

This PR will result in the following new package version: v0.2.0

It's a breaking change as a number of fields were removed or created in zuora_billing_history.

Please detail what change(s) this PR introduces and any additional information that should be known during the review of this PR:

  • Redesigned zuora__billing_history and int_zuora__billing_enriched so invoice_id was the actual grain, accounting for the cases when invoices can be tied to multiple credit balance adjustments and payments. This required the following steps:
    • All metrics associated with credit_balance_adjustment_id were aggregated on the invoice level (number of credit balance adjustments,total credit balance amount in home currency, first and last dates of credit balance adjustments on the invoice). Fields associated with an individual credit_balance_adjustment_id were removed.
    • All metrics associated with payment_id were aggregated on the invoice level (number of payments, total payment amount in home currency, first and last dates of payments on the invoice). Fields associated with an individual payment_id were removed.
    • Aggregated count of payment_method_id to gather a count of payment methods on each invoice.
  • Updated yml of zuora__billing_history with aggregated fields, and removed non-aggregated fields associated with credit balance adjustments, payments, and payment methods.
  • Modified int_zuora__account_enriched to account for new aggregated metric fields being pulled from zuora__billing_history.

PR Checklist

Basic Validation

Please acknowledge that you have successfully performed the following commands locally:

  • dbt compile
  • dbt run –full-refresh
  • dbt run
  • dbt test
  • dbt run –vars (if applicable)

Before marking this PR as "ready for review" the following have been applied:

  • The appropriate issue has been linked and tagged
  • You are assigned to the corresponding issue and this PR
  • BuildKite integration tests are passing

Detailed Validation

Please acknowledge that the following validation checks have been performed prior to marking this PR as "ready for review":

  • You have validated these changes and assure this PR will address the respective Issue/Feature.
  • You are reasonably confident these changes will not impact any other components of this package or any dependent packages.
  • You have provided details below around the validation steps performed to gain confidence in these changes.

Made sure that the models ran on dbt run --vars, particularly for adjusting the credit_balance_adjustment and taxation_item variables which are part of the CTEs that are modified.

For further validation, I recommend using the updated seed files and testing against the main branch to reproduce the bug, then making sure the new branch passes all tests.

Standard Updates

Please acknowledge that your PR contains the following standard updates:

  • Package versioning has been appropriately indexed in the following locations:
    • indexed within dbt_project.yml
    • indexed within integration_tests/dbt_project.yml
  • CHANGELOG has individual entries for each respective change in this PR
  • README updates have been applied (if applicable)
  • [NA] DECISIONLOG updates have been updated (if applicable)
  • Appropriate yml documentation has been added (if applicable)

dbt Docs

Please acknowledge that after the above were all completed the below were applied to your branch:

  • docs were regenerated (unless this PR does not include any code or yml updates)

If you had to summarize this PR in an emoji, which would it be?

🪙

@fivetran-avinash fivetran-avinash self-assigned this Aug 16, 2023
@fivetran-avinash fivetran-avinash linked an issue Aug 16, 2023 that may be closed by this pull request
4 tasks
@fivetran-avinash fivetran-avinash marked this pull request as ready for review August 16, 2023 23:32
CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Contributor Author

@fivetran-avinash fivetran-avinash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fivetran-reneeli Should be good for re-review!

Copy link

@fivetran-reneeli fivetran-reneeli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just remember to change the deps!

@fivetran-avinash fivetran-avinash merged commit ca4a4f4 into main Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] invoice_id is not unique
2 participants