Skip to content

Commit

Permalink
Release branch: v0.14.0 (#139)
Browse files Browse the repository at this point in the history
* Update customer and vendor joins

* customer vendor joins

* seeds, docs, test

* schema bump

* final fixes before PR review

* tweak schema in integration tests

* remove run results

* PR review updates

* update quickstart.yml

* update run_models.sh

* release-branch/v0.14.0

* Bugfix/too many partitions (#132)

* bugfix/too-many-partitions

* validation schema addition

* docs regen and final changes before review

* intermediate model conditional update

* Apply suggestions from code review

Co-authored-by: Avinash Kunnath <[email protected]>

* removing conditional logic

---------

Co-authored-by: Avinash Kunnath <[email protected]>

* regen docs

* release review

---------

Co-authored-by: Jared Monger <[email protected]>
Co-authored-by: Joe Markiewicz <[email protected]>
  • Loading branch information
3 people authored Sep 25, 2024
1 parent 9a50e99 commit 0300d33
Show file tree
Hide file tree
Showing 26 changed files with 334 additions and 84 deletions.
8 changes: 4 additions & 4 deletions .buildkite/scripts/run_models.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ dbt compile --vars '{netsuite_schema: netsuite_integrations_tests_sqlw}' --targe
dbt run --vars '{netsuite_schema: netsuite_integrations_tests_sqlw}' --target "$db" --full-refresh
dbt run --vars '{netsuite_schema: netsuite_integrations_tests_sqlw}' --target "$db"
dbt test --vars '{netsuite_schema: netsuite_integrations_tests_sqlw}' --target "$db"
dbt run --vars '{netsuite_schema: netsuite_integrations_tests_sqlw, netsuite2__using_to_subsidiary: true, netsuite2__multibook_accounting_enabled: true, netsuite2__using_exchange_rate: false, netsuite2__using_vendor_categories: false, netsuite2__using_jobs: false}' --target "$db" --full-refresh
dbt run --vars '{netsuite_schema: netsuite_integrations_tests_sqlw, netsuite2__using_to_subsidiary: true, netsuite2__multibook_accounting_enabled: true, netsuite2__using_exchange_rate: false, netsuite2__using_vendor_categories: false, netsuite2__using_jobs: false}' --target "$db"
dbt run --vars '{netsuite_schema: netsuite_integrations_tests_sqlw, netsuite2__using_to_subsidiary: true, netsuite2__multibook_accounting_enabled: true, netsuite2__using_exchange_rate: false, netsuite2__using_vendor_categories: false, netsuite2__using_jobs: false, netsuite2__using_employees: false}' --target "$db" --full-refresh
dbt run --vars '{netsuite_schema: netsuite_integrations_tests_sqlw, netsuite2__using_to_subsidiary: true, netsuite2__multibook_accounting_enabled: true, netsuite2__using_exchange_rate: false, netsuite2__using_vendor_categories: false, netsuite2__using_jobs: false, netsuite2__using_employees: false}' --target "$db"
dbt test --vars '{netsuite_schema: netsuite_integrations_tests_sqlw}' --target "$db"
dbt run --vars '{netsuite_schema: netsuite_integrations_tests_sqlw, netsuite2__using_to_subsidiary: true, netsuite2__using_exchange_rate: true}' --target "$db" --full-refresh
dbt run --vars '{netsuite_schema: netsuite_integrations_tests_sqlw, netsuite2__using_to_subsidiary: true, netsuite2__using_exchange_rate: true}' --target "$db"
Expand All @@ -38,8 +38,8 @@ dbt compile --target "$db"
dbt run --target "$db" --full-refresh
dbt run --target "$db"
dbt test --target "$db"
dbt run --vars '{netsuite2__using_to_subsidiary: true, netsuite2__multibook_accounting_enabled: true, netsuite2__using_exchange_rate: false, netsuite2__using_vendor_categories: false, netsuite2__using_jobs: false}' --target "$db" --full-refresh
dbt run --vars '{netsuite2__using_to_subsidiary: true, netsuite2__multibook_accounting_enabled: true, netsuite2__using_exchange_rate: false, netsuite2__using_vendor_categories: false, netsuite2__using_jobs: false}' --target "$db"
dbt run --vars '{netsuite2__using_to_subsidiary: true, netsuite2__multibook_accounting_enabled: true, netsuite2__using_exchange_rate: false, netsuite2__using_vendor_categories: false, netsuite2__using_jobs: false, netsuite2__using_employees: false}' --target "$db" --full-refresh
dbt run --vars '{netsuite2__using_to_subsidiary: true, netsuite2__multibook_accounting_enabled: true, netsuite2__using_exchange_rate: false, netsuite2__using_vendor_categories: false, netsuite2__using_jobs: false, netsuite2__using_employees: false}' --target "$db"
dbt test --target "$db"
dbt run --vars '{netsuite2__using_to_subsidiary: true, netsuite2__using_exchange_rate: true}' --target "$db" --full-refresh
dbt run --vars '{netsuite2__using_to_subsidiary: true, netsuite2__using_exchange_rate: true}' --target "$db"
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ dbt_modules/
logs/
.DS_Store
dbt_packages/
env/
env/
package-lock.yml
2 changes: 2 additions & 0 deletions .quickstart/quickstart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ table_variables:
- VendorCategory
netsuite2__using_jobs:
- job
netsuite2__using_employees:
- employee

destination_configurations:
databricks:
Expand Down
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
# dbt_netsuite v0.14.0

For Netsuite2, [PR #138](https://github.com/fivetran/dbt_netsuite/pull/138) and [PR #132](https://github.com/fivetran/dbt_netsuite/pull/132) include the following updates:

## Breaking Changes (Full refresh required after upgrading)
- Partitioned models have had the `partition_by` logic adjusted to include a granularity of a month. This change should only impact BigQuery warehouses and was applied to avoid the common `too many partitions` error users have experienced due to over-partitioning by day. Therefore, adjusting the partition to a monthly granularity will increase the partition windows and allow for more performant querying.
- This change was applied to the following models:
- `int_netsuite2__tran_with_converted_amounts`
- `netsuite2__balance_sheet`
- `netsuite2__income_statement`
- `netsuite2__transaction_details`

## Upstream Netsuite Source Breaking Changes (Full refresh required after upgrading)
- Casted specific timestamp fields across all staging models as dates where the Netsuite UI does not perform timezone conversion. Keeping these fields as type timestamp causes issues in reporting tools that perform automatic timezone conversion.
- Adds additional commonly used fields within the `stg_netsuite2__*` models.
> **IMPORTANT**: Nearly all of the affected models have pass-through functionality. If you have already been using passthrough column variables to include the newly added fields (without aliases), you **MUST** remove the fields from your passthrough variable configuration in order to avoid duplicate column errors.
- Please refer to the [v0.11.0 `dbt_netsuite_source` release](https://github.com/fivetran/dbt_netsuite_source/releases/tag/v0.11.0) for more details regarding the upstream changes to view the fields that were added and impacted.

## Bug Fixes
- Updates logic in `netsuite2__transaction_details` to select the appropriate customer and vendor values based on the whether the transaction type is a customer invoice or credit, or a vendor bill or credit.
- Customer fields impacted: `company_name`, `customer_city`, `customer_state`, `customer_zipcode`, `customer_country`, `customer_date_first_order`, `customer_external_id`.
- Vendor fields impacted: `vendor_category_name`, `vendor_name`, `vendor_create_date`.

## Feature Updates
- New fields `customer_alt_name` and `vendor_alt_name` were introduced into `netsuite2__transaction_details`, after being added into the `stg_netsuite2__customers` and `stg_netsuite2__vendors` models in the most [recent release of `dbt_netsuite_source`](https://github.com/fivetran/dbt_netsuite_source/releases/tag/v0.11.0).
- We added the `employee` model in the [`v0.11.0` release of `dbt_netsuite_source`](https://github.com/fivetran/dbt_netsuite_source/releases/tag/v0.11.0), which will materialize `stg_netsuite2__employees` from the source package by default.
- Since this model is only used by a subset of customers, we've introduced the variable `netsuite2__using_employees` to allow users who don't utilize the `employee` table in Netsuite2 the ability to disable that functionality within your `dbt_project.yml`. This value is set to true by default. [Instructions are available in the README for how to disable this variable](https://github.com/fivetran/dbt_netsuite/?tab=readme-ov-file#step-5-disable-models-for-non-existent-sources-netsuite2-only).

## Under the Hood
- Consistency tests added for each Netsuite2 end model in order to be used during integration test validations.

## Contributors
- [@jmongerlyra](https://github.com/jmongerlyra) ([PR #131](https://github.com/fivetran/dbt_netsuite/pull/131))

# dbt_netsuite v0.13.0

For Netsuite2, [PR #116](https://github.com/fivetran/dbt_netsuite/pull/116) includes the following updates:
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Include the following netsuite package version in your `packages.yml` file:
```yaml
packages:
- package: fivetran/netsuite
version: [">=0.13.0", "<0.14.0"]
version: [">=0.14.0", "<0.15.0"]
```
### Step 3: Define Netsuite.com or Netsuite2 Source
As of April 2022 Fivetran made available a new Netsuite connector which leverages the Netsuite2 endpoint opposed to the original Netsuite.com endpoint. This package is designed to run for either or, not both. By default the `netsuite_data_model` variable for this package is set to the original `netsuite` value which runs the netsuite.com version of the package. If you would like to run the package on Netsuite2 data, you may adjust the `netsuite_data_model` variable to run the `netsuite2` version of the package.
Expand All @@ -127,6 +127,7 @@ vars:
netsuite2__using_exchange_rate: false #True by default. Disable `exchange_rate` if you don't utilize exchange rates. If you set this variable to false, ensure it is scoped globally so that the `netsuite_source` package can access it as well.
netsuite2__using_vendor_categories: false # True by default. Disable `vendorcategory` if you don't categorize your vendors
netsuite2__using_jobs: false # True by default. Disable `job` if you don't use jobs
netsuite2__using_employees: false # True by default. Disable `employee` if you don't use employees.
```
> **Note**: The Netsuite dbt package currently only supports disabling transforms of [Multi-Book Accounting](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/book_3831565332.html) related tables (`accountingbooksubsidiary` and `accountingbook`) and the `vendorcategory` and `job` source tables. Please create an issue to request additional tables and/or [features](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/bridgehead_N233872.html) to exclude.
>
Expand All @@ -138,6 +139,7 @@ vars:

#### Multi-Book (Netsuite2 only)
To include `accounting_book_id` and `accounting_book_name` columns in the end models, set the below variable to `true` in your `dbt_project.yml`. This feature is disabled by default.

>Notes:
> - If you choose to enable this feature, this will add rows for transactions for any non-primary `accounting_book_id`, and your downstream use cases may need to be adjusted.
> - The surrogate keys for the end models are dynamically generated depending on the enabled/disabled features, so adding these rows will not cause test failures.
Expand All @@ -147,6 +149,8 @@ vars:
netsuite2__multibook_accounting_enabled: true # False by default.
```

**IMPORTANT**: If you are using multi-book accounting, this variable must be set to true, or you will see test failures in your data.

#### To Subsidiary (Netsuite2 only)
To include `to_subsidiary_id` and `to_subsidiary_name` columns in the end models, set the below variable to `true` in your `dbt_project.yml`. This feature is disabled by default. You will also need to be using exchange rates, which is enabled by default.

Expand Down Expand Up @@ -282,7 +286,7 @@ This dbt package is dependent on the following dbt packages. These dependencies
```yml
packages:
- package: fivetran/netsuite_source
version: [">=0.10.0", "<0.11.0"]
version: [">=0.11.0", "<0.12.0"]
- package: fivetran/fivetran_utils
version: [">=0.4.0", "<0.5.0"]
Expand Down
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
config-version: 2
name: 'netsuite'
version: '0.13.0'
version: '0.14.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.

Loading

0 comments on commit 0300d33

Please sign in to comment.