Skip to content

Commit 1a42b0d

Browse files
Merge pull request #7 from fivetran/bug/multi-fixes
Bug/multi fixes
2 parents cb8e54f + 15436ab commit 1a42b0d

14 files changed

+113
-17
lines changed

.circleci/config.yml

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,19 @@ jobs:
2222
pip install -r integration_tests/requirements.txt
2323
mkdir -p ~/.dbt
2424
cp integration_tests/ci/sample.profiles.yml ~/.dbt/profiles.yml
25-
- run:
26-
name: "Run Tests - Spark"
27-
command: |
28-
. venv/bin/activate
29-
echo `pwd`
30-
cd integration_tests
31-
dbt deps
32-
dbt seed --target spark --full-refresh
33-
dbt run --target spark --full-refresh
34-
dbt test --target spark
3525
- run:
3626
name: "Run Tests - Redshift"
3727
command: |
3828
. venv/bin/activate
3929
echo `pwd`
4030
cd integration_tests
31+
dbt clean
4132
dbt deps
4233
dbt seed --target redshift --full-refresh
4334
dbt run --target redshift --full-refresh
4435
dbt test --target redshift
36+
dbt run --vars '{sage_intacct__using_invoices: false, sage_intacct__using_bills: false}' --full-refresh --target redshift
37+
dbt test --target redshift
4538
- run:
4639
name: "Run Tests - Postgres"
4740
command: |
@@ -52,6 +45,20 @@ jobs:
5245
dbt seed --target postgres --full-refresh
5346
dbt run --target postgres --full-refresh
5447
dbt test --target postgres
48+
dbt run --vars '{sage_intacct__using_invoices: false, sage_intacct__using_bills: false}' --full-refresh --target postgres
49+
dbt test --target postgres
50+
- run:
51+
name: "Run Tests - Spark"
52+
command: |
53+
. venv/bin/activate
54+
echo `pwd`
55+
cd integration_tests
56+
dbt deps
57+
dbt seed --target spark --full-refresh
58+
dbt run --target spark --full-refresh
59+
dbt test --target spark
60+
dbt run --vars '{sage_intacct__using_invoices: false, sage_intacct__using_bills: false}' --full-refresh --target spark
61+
dbt test --target spark
5562
- run:
5663
name: "Run Tests - Snowflake"
5764
command: |
@@ -62,6 +69,8 @@ jobs:
6269
dbt seed --target snowflake --full-refresh
6370
dbt run --target snowflake --full-refresh
6471
dbt test --target snowflake
72+
dbt run --vars '{sage_intacct__using_invoices: false, sage_intacct__using_bills: false}' --full-refresh --target snowflake
73+
dbt test --target snowflake
6574
- run:
6675
name: "Run Tests - BigQuery"
6776
environment:
@@ -74,4 +83,6 @@ jobs:
7483
dbt deps
7584
dbt seed --target bigquery --full-refresh
7685
dbt run --target bigquery --full-refresh
86+
dbt test --target bigquery
87+
dbt run --vars '{sage_intacct__using_invoices: false, sage_intacct__using_bills: false}' --full-refresh --target bigquery
7788
dbt test --target bigquery

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
# dbt_sage_intacct_source v0.1.1
2+
3+
## Updates
4+
- Excludes fivetran-deleted rows in the staging models
5+
([#7](https://github.com/fivetran/dbt_sage_intacct/issues/7))
6+
7+
- Allow for pass-through columns from the `gl_detail` and `gl_account` source tables using the following variables. For more information please refer to the [README](https://github.com/fivetran/dbt_sage_intacct_source/blob/main/README.md#passthrough-columns)
8+
- `sage_account_pass_through_columns`
9+
- `sage_gl_pass_through_columns`
10+
11+
- Add variable configs for the AP Bill and AR Invoice related tables to allow users to disable them if not used. For more information please refer to the [README](https://github.com/fivetran/dbt_sage_intacct_source/blob/main/README.md#disabling-and-enabling-models)
12+
- `sage_intacct__using_bills`
13+
- `sage_intacct__using_invoices`
14+
15+
- Include additional fields in the `gl_detail` model: customer_id, customer_name, department_id, department_title, location_id, location_name, vendor_id, and vendor_name.
16+
17+
([#6](https://github.com/fivetran/dbt_sage_intacct/issues/6))
18+
19+
## Contributors
20+
Thank you @santi95 for raising these to our attention! ([#6](https://github.com/fivetran/dbt_sage_intacct_source/pull/6))
21+
122
# dbt_sage_intacct_source v0.1.0
223

324
## Initial Release

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,26 @@ Columns passed through must be present in the upstream source tables. See below
5656
vars:
5757
sage_intacct_source:
5858
sage_account_pass_through_columns: ['new_custom_field', 'custom_field_2']
59+
sage_gl_pass_through_columns: ['custom_field_3', 'custom_field_4']
5960
```
6061

62+
### Disabling and Enabling Models
63+
64+
When setting up your Sage Intacct connection in Fivetran, it is possible that not every table this package expects will be synced. This can occur because you either don't use that functionality in Sage or have actively decided to not sync some tables. In order to disable the relevant functionality in the package, you will need to add the relevant variables.
65+
66+
By default, all variables are assumed to be `true`. You only need to add variables for the tables you would like to disable:
67+
68+
```yml
69+
# dbt_project.yml
70+
71+
config-version: 2
72+
73+
vars:
74+
sage_intacct__using_invoices: false # default is true
75+
sage_intacct__using_bills: false # default is true
76+
```
77+
78+
6179
### Change the Build Schema
6280
By default, this package builds the Sage Intacct staging models within a schema titled (<target_schema> + `_stg_sage_intacct`) in your target database. If this is not where you would like your Sage Intacct staging data to be written to, add the following configuration to your `dbt_project.yml` file:
6381

dbt_project.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: 'sage_intacct_source'
2-
version: '0.1.0'
2+
version: '0.1.1'
33
config-version: 2
44
require-dbt-version: [">=1.0.0", "<2.0.0"]
55

@@ -19,5 +19,14 @@ vars:
1919
ar_invoice_item: "{{ source('sage_intacct','ar_invoice_item') }}"
2020
ar_invoice: "{{ source('sage_intacct','ar_invoice') }}"
2121

22-
sage_account_pass_through_columns: []
22+
sage_account_pass_through_columns: []
23+
sage_gl_pass_through_columns: []
2324

25+
sage_intacct__using_bills: true
26+
sage_intacct__using_invoices: true
27+
28+
29+
30+
clean-targets:
31+
- target
32+
- dbt_modules

integration_tests/dbt_project.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
name: 'sage_intacct_source_integration_tests'
3-
version: '0.1.0'
3+
version: '0.1.1'
44
config-version: 2
55

66
profile: 'integration_tests'

macros/get_gl_detail_columns.sql

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{% macro get_gl_detail_columns() %}
2-
32
{% set columns = [
43
{"name": "_fivetran_deleted", "datatype": "boolean"},
54
{"name": "_fivetran_synced", "datatype": dbt_utils.type_timestamp()},
@@ -12,11 +11,15 @@
1211
{"name": "batch_title", "datatype": dbt_utils.type_string()},
1312
{"name": "batchkey", "datatype": dbt_utils.type_string()},
1413
{"name": "bookid", "datatype": dbt_utils.type_string()},
14+
{"name": "classid", "datatype": dbt_utils.type_string()},
15+
{"name": "classname", "datatype": dbt_utils.type_string()},
1516
{"name": "creditamount", "datatype": dbt_utils.type_float()},
1617
{"name": "currency", "datatype": dbt_utils.type_string()},
1718
{"name": "customerid", "datatype": dbt_utils.type_string()},
1819
{"name": "customername", "datatype": dbt_utils.type_string()},
1920
{"name": "debitamount", "datatype": dbt_utils.type_float()},
21+
{"name": "departmentid", "datatype": dbt_utils.type_string()},
22+
{"name": "departmenttitle", "datatype": dbt_utils.type_string()},
2023
{"name": "description", "datatype": dbt_utils.type_string()},
2124
{"name": "docnumber", "datatype": dbt_utils.type_string()},
2225
{"name": "document", "datatype": dbt_utils.type_string()},
@@ -27,6 +30,7 @@
2730
{"name": "locationid", "datatype": dbt_utils.type_string()},
2831
{"name": "locationname", "datatype": dbt_utils.type_string()},
2932
{"name": "modified", "datatype": dbt_utils.type_timestamp()},
33+
{"name": "prdescription", "datatype": dbt_utils.type_string()},
3034
{"name": "recordid", "datatype": dbt_utils.type_string()},
3135
{"name": "recordno", "datatype": dbt_utils.type_string()},
3236
{"name": "recordtype", "datatype": dbt_utils.type_string()},
@@ -44,7 +48,5 @@
4448
{"name": "whenmodified", "datatype": dbt_utils.type_timestamp()},
4549
{"name": "whenpaid", "datatype": "date"}
4650
] %}
47-
4851
{{ return(columns) }}
49-
50-
{% endmacro %}
52+
{% endmacro %}

models/stg_sage_intacct__ap_bill.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{ config(enabled=var('sage_intacct__using_bills', True)) }}
12

23
with base as (
34

@@ -52,3 +53,4 @@ final as (
5253
)
5354

5455
select * from final
56+
where not coalesce(_fivetran_deleted, false)

models/stg_sage_intacct__ap_bill_item.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
{{ config(enabled=var('sage_intacct__using_bills', True)) }}
2+
13
with base as (
24

35
select *

models/stg_sage_intacct__ar_invoice.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{ config(enabled=var('sage_intacct__using_invoices', True)) }}
12

23
with base as (
34

@@ -55,3 +56,4 @@ final as (
5556
)
5657

5758
select * from final
59+
where not coalesce(_fivetran_deleted, false)

models/stg_sage_intacct__ar_invoice_item.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{ config(enabled=var('sage_intacct__using_invoices', True)) }}
12

23
with base as (
34

0 commit comments

Comments
 (0)