Skip to content

Commit

Permalink
Merge pull request #73 from fivetran/bug/ledger-test-errors
Browse files Browse the repository at this point in the history
Update quickbooks__general_ledger surrogate key to use account_id rat…
  • Loading branch information
fivetran-avinash authored Feb 16, 2023
2 parents a9c8fc5 + dcb7c52 commit 3ac069c
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 16 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# dbt_quickbooks v0.8.0
## 🚨 Breaking Changes 🚨
- Replacing `account_name` with `account_id` as input for the `generate_surrogate_key` function to fix `unique_id` uniqueness issues in the `quickbooks__general_ledger` model. A full refresh is recommended for accurate and consistent surrogate keys. ([#73](https://github.com/fivetran/dbt_quickbooks/pull/73))

# dbt_quickbooks v0.7.0
## 🚨 Breaking Changes 🚨:
## 🚨 Breaking Changes 🚨
- Added `transaction_source` to `generate_surrogate_key` function to fix `unique_id` uniqueness issues in the `quickbooks__general_ledger` model. A full refresh is recommended for accurate and consistent surrogate keys, for more information please refer to dbt-utils [release notes](https://github.com/dbt-labs/dbt-utils/releases/tag/1.0.0) regarding `generate_surrogate_key`. ([#62](https://github.com/fivetran/dbt_quickbooks/pull/62))

## Additional Features
Expand All @@ -14,7 +18,7 @@
- Added `quickbooks_[source_table_name]_identifier` variables so it's easier to refer to source tables with different names. ([#71](https://github.com/fivetran/dbt_quickbooks/pull/71))

# dbt_quickbooks v0.6.0
## 🚨 Breaking Changes 🚨:
## 🚨 Breaking Changes 🚨
[PR #51](https://github.com/fivetran/dbt_quickbooks/pull/51) includes the following breaking changes:
- Dispatch update for dbt-utils to dbt-core cross-db macros migration. Specifically `{{ dbt_utils.<macro> }}` have been updated to `{{ dbt.<macro> }}` for the below macros:
- `any_value`
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Include the following QuickBooks package version in your `packages.yml` file.
```yaml
packages:
- package: fivetran/quickbooks
version: [">=0.7.0", "<0.8.0"]
version: [">=0.8.0", "<0.9.0"]
```
## Step 3: Define database and schema variables
Expand Down
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
config-version: 2
name: 'quickbooks'

version: '0.7.0'
version: '0.8.0'
require-dbt-version: [">=1.3.0", "<2.0.0"]

models:
Expand Down
2 changes: 1 addition & 1 deletion docs/catalog.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/manifest.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/run_results.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'quickbooks_integration_tests'

version: '0.7.0'
version: '0.8.0'

profile: 'integration_tests'
config-version: 2
Expand Down
4 changes: 1 addition & 3 deletions integration_tests/seeds/invoice_data.csv
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,4 @@ id,_fivetran_deleted,_fivetran_synced,allow_ipnpayment,allow_online_achpayment,a
31709,TRUE,2020-08-31 22:30:46,,,,,,,,,,b9c5e50ca61c38e84166419f9dce62c9,,2020-08-21 21:16:42,USD,,,,,2020-08-21 0:00:00,Email,,,,,,,,,,,,,,,,,,,0,,,,2020-08-25 13:32:23
39827,TRUE,2021-01-13 17:16:18,,,,,,,,,,d41d8cd98f00b204e9800998ecf8427e,,2021-01-13 0:23:29,USD,,,,,,,,,,,,,,,,,,,,,,,,,0,,,,2021-01-13 0:23:29
26982,TRUE,2020-04-07 18:32:28,,,,,,,,,,88e8d1bd6d6ed3790c72d29bc8e1c6f7,,2020-04-07 15:47:18,USD,,,,e1434e59faf86d6098275bb09bf2ab89,2020-04-07 0:00:00,Email,,,,,,,,,,,,,,,,,,,0,,,,2020-04-07 16:46:07
39826,TRUE,2021-01-13 17:16:18,,,,,,,,,,c29e8c3627595c63550702485759ca61,,2021-01-13 0:23:28,USD,,,,,,,,,,,,,,,,,,,,,,,,,0,,,,2021-01-13 0:23:28
22486,TRUE,2020-01-30 17:00:35,,,,,,,,,,2d15ecdbbc48d3eccee760148e729988,,2020-01-28 21:35:32,USD,,,,,,,,,,,,,,,,,,,,,,,,,0,,,,2020-01-28 21:35:54
35872,TRUE,2020-11-10 17:15:43,,,,,,,,,,d41d8cd98f00b204e9800998ecf8427e,,2020-11-09 16:06:12,USD,,,,,2020-11-09 0:00:00,Email,,,,,,,,,,,,,,,,,,,0,,,,2020-11-09 22:38:36
39826,TRUE,2021-01-13 17:16:18,,,,,,,,,,c29e8c3627595c63550702485759ca61,,2021-01-13 0:23:28,USD,,,,,,,,,,,,,,,,,,,,,,,,,0,,,,2021-01-13 0:23:28
4 changes: 1 addition & 3 deletions integration_tests/seeds/invoice_line_data.csv
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@ index,invoice_id,_fivetran_synced,amount,bundle_id,bundle_quantity,description,d
3,35647,2021-01-18 6:16:26,-4280.01,,,2ae778d8d42424d33b656517b2c892bf,,,,,,,,224,,,,34,0.7,,NON,-6120,,,,,
1,35647,2021-01-18 6:16:26,1748.37,,,,,,,,,,,211,,,,227,0.7,,NON,2500,,,,,
0,40092,2021-01-19 2:18:38,21437.5,212,0.5,,,,,,,,,,,,,,,,,,,,,,
10,40092,2021-01-19 2:18:38,17181.75,,,,,,,,,,,,,,,,,,,,,,,,
4,40092,2021-01-19 2:18:38,0,,,7f3c88bf068c8edd47367bd68c01cd8f,,,,,,,,,,,,18,,,NON,,,,,,
7,40092,2021-01-19 2:18:38,0,,,703d01ddc458e55f5b43da8c88aaa581,,,,,,,,,,,,18,,,NON,,,,,,
10,40092,2021-01-19 2:18:38,17181.75,,,,,,,,,,,,,,,,,,,,,,,,
2 changes: 1 addition & 1 deletion models/quickbooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ models:
- source_relation
columns:
- name: unique_id
description: Unique identifier of the general ledger line, dependent on `transaction_id`, `transaction_index`, `account_name, `transaction_type`, `transaction_source`.
description: Unique identifier of the general ledger line, dependent on `transaction_id`, `transaction_index`, `account_id`, `transaction_type`, `transaction_source`.
- name: transaction_id
description: "{{ doc('transaction_id') }}. Each transaction will have an offsetting debit and credit record."
- name: transaction_index
Expand Down
2 changes: 1 addition & 1 deletion models/quickbooks__general_ledger.sql
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ accounts as (
adjusted_gl as (

select
{{ dbt_utils.generate_surrogate_key(['gl_union.transaction_id', 'gl_union.index', 'accounts.name', ' gl_union.transaction_type', 'gl_union.transaction_source']) }} as unique_id,
{{ dbt_utils.generate_surrogate_key(['gl_union.transaction_id', 'gl_union.index', 'gl_union.account_id', ' gl_union.transaction_type', 'gl_union.transaction_source']) }} as unique_id,
gl_union.transaction_id,
gl_union.source_relation,
gl_union.index as transaction_index,
Expand Down

0 comments on commit 3ac069c

Please sign in to comment.