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

Add in subindices to match every subledger model #41

Merged
merged 17 commits into from
Aug 24, 2022

Conversation

fivetran-avinash
Copy link
Contributor

@fivetran-avinash fivetran-avinash commented Aug 13, 2022

Pull Request
Are you a current Fivetran customer?

What change(s) does this PR introduce?

Bug fixes

  • Add subledger indexes from Quickbooks model, reconciled financial discrepancies from older model.
  • Using subledger indexes at the moment in place of row number model we created at quickbooks__general_ledger model.
  • Created new surrogate key in general ledger to produce unique id.

Did you update the CHANGELOG?

  • Yes

Does this PR introduce a breaking change?

  • Yes (please provide breaking change details below.)
  • No (please provide an explanation as to how the change is non-breaking below.)

Did you update the dbt_project.yml files with the version upgrade (please leverage standard semantic versioning)? (In both your main project and integration_tests)

  • Yes

Is this PR in response to a previously created Bug or Feature Request

How did you test the PR changes?

  • CircleCi
  • Local (please provide additional testing details below)

Select which warehouse(s) were used to test the PR

  • BigQuery
  • Redshift
  • Snowflake
  • Postgres
  • Databricks
  • Other (provide details below)

Provide an emoji that best describes your current mood

🚒

Feedback

We are so excited you decided to contribute to the Fivetran community dbt package! We continue to work to improve the packages and would greatly appreciate your feedback on our existing dbt packages or what you'd like to see next.

@fivetran-joemarkiewicz fivetran-joemarkiewicz marked this pull request as ready for review August 18, 2022 20:09
Copy link
Contributor

@fivetran-joemarkiewicz fivetran-joemarkiewicz left a comment

Choose a reason for hiding this comment

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

@fivetran-avinash great job tackling this update and for being so diligent in your testing! 🏅 This definitely turned out to be a large scale update then we originally intended 🤯.

I have a few suggestions and requested changes within the review. Let me know if you have any questions!

CHANGELOG.md Outdated
@@ -1,3 +1,7 @@
# dbt_quickbooks v0.5.1
## Bug Fixes 🐛🪛
- Created indices for `double_entry_transactions` models. Used row_number functions for `payment`, `bill_payment` and `transfer` models.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we call out that people will see duplicate indices since we are creating double entries for these records? This may be helpful since it could be confusing that there are duplicates.

@@ -95,7 +96,7 @@ accounts as (
adjusted_gl as (
select
gl_union.transaction_id,
row_number() over(partition by gl_union.transaction_id order by gl_union.transaction_date) as transaction_index,
index as transaction_index,
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the transaction_index can be repeating now, it may be beneficial to add a surrogate key to identify uniqueness.

I am thinking a combination of gl_union.transaction_id, gl_union.index, and accounts.name. What are your thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@fivetran-joemarkiewicz Doesn't seem to work, we have repeating values.

SELECT transaction_id, transaction_index, account_name, COUNT(*)
FROM dbt-package-testing.dbt_avinash_quickbooks_dev.quickbooks__general_ledger
GROUP BY 1, 2, 3
ORDER BY 4 DESC

Copy link
Contributor Author

Choose a reason for hiding this comment

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

New changes added!

fivetran-avinash and others added 2 commits August 18, 2022 15:19
Co-authored-by: Joe Markiewicz <74217849+fivetran-joemarkiewicz@users.noreply.github.com>
Co-authored-by: Joe Markiewicz <74217849+fivetran-joemarkiewicz@users.noreply.github.com>
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.

Review completed and changes applied!

@@ -95,7 +96,7 @@ accounts as (
adjusted_gl as (
select
gl_union.transaction_id,
row_number() over(partition by gl_union.transaction_id order by gl_union.transaction_date) as transaction_index,
index as transaction_index,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@fivetran-joemarkiewicz Doesn't seem to work, we have repeating values.

SELECT transaction_id, transaction_index, account_name, COUNT(*)
FROM dbt-package-testing.dbt_avinash_quickbooks_dev.quickbooks__general_ledger
GROUP BY 1, 2, 3
ORDER BY 4 DESC

@@ -95,7 +96,7 @@ accounts as (
adjusted_gl as (
select
gl_union.transaction_id,
row_number() over(partition by gl_union.transaction_id order by gl_union.transaction_date) as transaction_index,
index as transaction_index,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

New changes added!

Copy link
Contributor

@fivetran-joemarkiewicz fivetran-joemarkiewicz left a comment

Choose a reason for hiding this comment

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

Great job applying these updates @fivetran-avinash! They are looking good on my end. I have two super small requests to change before we merge and release (see notes below).

Once those are applied, we will be good to merge and release! 🎉

@fivetran-avinash fivetran-avinash merged commit 7adf274 into main Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants