-
Notifications
You must be signed in to change notification settings - Fork 30
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
update uniqueness test #74
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-reneeli thanks for working through these updates, I just have a few questions and suggestions before this will be good to approve. Let me know if you would like to discuss in more detail.
models/stg_stripe.yml
Outdated
- dbt_utils.unique_combination_of_columns: | ||
combination_of_columns: | ||
- unique_invoice_line_item_id | ||
- invoice_id | ||
- source_relation |
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.
Is this necessary? Wouldn't it make more sense to include unique_invoice_line_item_id
in the unique combination of columns test above as opposed to creating a new test?
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.
Actually, do we even need to include this in the test? It seems the original unique combination of columns test is passing just fine. Since the unique_id is an artifact of an older Stripe API, should we just remove the test on that field altogether? It seems like testing on invoice_id and invoice_line_id is sufficient. What are your thoughts?
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.
Ah I see, keep the existing unique test on the combination of invoice_id
and invoice_line_id
, just remove the unique test on unique_invoice_line_item_id
. The hesitancy I have with that is it then diverges from the ERD.
Given that, a good compromise could be your first suggestion, adding unique_invoice_line_item_id
to the existing test.
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.
Yeah I would not create a new test in this release. I would prefer we remove the failing one and then either not test the unique_id
anymore or include it in the existing test.
This may be a hot take, but I would actually recommend we don't include the unique_id
at all and we just remove the test. From your investigation we have found that the unique_id
is an artifact from a release from January 2020. We also can see the unique combo test on invoice_id and invoice_line_id is working as expected. I would worry that adding the unique_id
to that test would not actually be an accurate representation of the uniqueness of the table.
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.
As per internal discussion with team, will remove the uniqueness test from unique_id entirely. Will see if any changes are needed on the connector end.
CHANGELOG.md
Outdated
[PR [#74](https://github.com/fivetran/dbt_stripe_source/pull/74)] includes the following updates: | ||
|
||
## 🚨 Breaking Changes 🚨 | ||
- Updates the `unique_invoice_line_item_id` uniqueness test in `stg_stripe__invoice_line_item` to include `invoice_id`. This is because `unique_invoice_line_item_id` (`unique_id` in the raw source `invoice_line_item` table) was part of an older version of Stripe that was included in the new version to help migrate internal references. See the Stripe [API update](https://stripe.com/docs/upgrades#2019-12-03) for more information. The Fivetran connector persists this in order to resolve the pagination break issue for invoice line items that was introduced by the [API update](https://stripe.com/docs/upgrades#2019-12-03). |
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.
Request to update this based on feedback from the test updates.
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.
Additionally, is there a reason this is listed as a breaking change? If it is a breaking change, we will need to bump the version to v0.12.0 and also make a breaking change downstream in the dbt_stripe package.
I am not entirely sure a breaking change is needed here.
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.
Yes update based on above! And true, I changed this to a bugfix.
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 make the appropriate updates here based on the other comment.
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-reneeli I just responded to your comments. Let me know if you have any questions or would like to discuss further. Once the remaining updates are applied I will give this a re-review.
models/stg_stripe.yml
Outdated
- dbt_utils.unique_combination_of_columns: | ||
combination_of_columns: | ||
- unique_invoice_line_item_id | ||
- invoice_id | ||
- source_relation |
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.
Yeah I would not create a new test in this release. I would prefer we remove the failing one and then either not test the unique_id
anymore or include it in the existing test.
This may be a hot take, but I would actually recommend we don't include the unique_id
at all and we just remove the test. From your investigation we have found that the unique_id
is an artifact from a release from January 2020. We also can see the unique combo test on invoice_id and invoice_line_id is working as expected. I would worry that adding the unique_id
to that test would not actually be an accurate representation of the uniqueness of the table.
CHANGELOG.md
Outdated
[PR [#74](https://github.com/fivetran/dbt_stripe_source/pull/74)] includes the following updates: | ||
|
||
## 🚨 Breaking Changes 🚨 | ||
- Updates the `unique_invoice_line_item_id` uniqueness test in `stg_stripe__invoice_line_item` to include `invoice_id`. This is because `unique_invoice_line_item_id` (`unique_id` in the raw source `invoice_line_item` table) was part of an older version of Stripe that was included in the new version to help migrate internal references. See the Stripe [API update](https://stripe.com/docs/upgrades#2019-12-03) for more information. The Fivetran connector persists this in order to resolve the pagination break issue for invoice line items that was introduced by the [API update](https://stripe.com/docs/upgrades#2019-12-03). |
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 make the appropriate updates here based on the other comment.
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.
LGTM
PR Overview
This PR will address the following Issue/Feature:
#73
This PR will result in the following new package version: v0.11.1
Please provide the finalized CHANGELOG entry which details the relevant changes included in this PR:
🚨 Breaking Changes 🚨
unique_invoice_line_item_id
uniqueness test instg_stripe__invoice_line_item
to includeinvoice_id
. This is becauseunique_invoice_line_item_id
(unique_id
in the raw sourceinvoice_line_item
table) was part of an older version of Stripe that was included in the new version to help migrate internal references. See the Stripe API update for more information. The Fivetran connector persists this in order to resolve the pagination break issue for invoice line items that was introduced by the API update.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?
💃