From 47ec57c26c8a276b410ef5cee79dca93ed4bd6c6 Mon Sep 17 00:00:00 2001 From: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com> Date: Mon, 26 Sep 2022 11:06:27 -0500 Subject: [PATCH 1/6] bug/update-disabling-models --- README.md | 10 ++++++++-- dbt_project.yml | 8 -------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 039947d..c98bab3 100644 --- a/README.md +++ b/README.md @@ -74,9 +74,9 @@ vars: ``` ### Disabling Models -Your connector may not be syncing all tabes that this package references. This might be because you are excluding those tables. If you are not using those tables, you can disable the corresponding functionality in the package by specifying the variable in your `dbt_project.yml`. The metrics from the disabled tables will not populate in downstream models. By default, all packages are assumed to be true. You only have to add variables for tables you want to disable, like so: +It is possible that your Salesforce connector does not sync every table that this package expects. If your syncs exclude certain tables, it is because you either don't use that functionality in Salesforce or actively excluded some tables from your syncs. -The `salesforce__user_role_enabled` variable below refers to the `user_role` table. +To disable the corresponding functionality in this package, you must add the corresponding variable(s) to your `dbt_project.yml`, which are listed below. By default, that is if none of these variables are added, all variables are assumed to be true. Add variables only for the tables you would like to disable: ```yml # dbt_project.yml @@ -86,6 +86,12 @@ config-version: 2 vars: salesforce__user_role_enabled: false # Disable if you do not have the user_role table + salesforce__lead_enabled: false # Disable if you do not have the lead table + salesforce__event_enabled: false # Disable if you do not have the event table + salesforce__task_enabled: false # Disable if you do not have the task table + salesforce__opportunity_line_item_enabled: false # Disable if you do not have the opportunity_line_item table + salesforce__order_enabled: false # Disable if you do not have the order table + salesforce__product_2_enabled: false # Disable if you do not have the product_2 table ``` The corresponding metrics from the disabled tables will not populate in the downstream models. diff --git a/dbt_project.yml b/dbt_project.yml index d36669f..a95fdb2 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -35,14 +35,6 @@ vars: user_role_pass_through_columns: [] user_pass_through_columns: [] - # Variable for whether you are using the user_role table (default is set to True) - salesforce__user_role_enabled: true - salesforce__lead_enabled: true - salesforce__event_enabled: true - salesforce__task_enabled: true - salesforce__opportunity_line_item_enabled: true - salesforce__order_enabled: true - salesforce__product_2_enabled: true clean-targets: - target From b013452a3838a1501cfc951ba1f3d262fafcdc40 Mon Sep 17 00:00:00 2001 From: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com> Date: Mon, 26 Sep 2022 11:10:24 -0500 Subject: [PATCH 2/6] update changelog --- CHANGELOG.md | 5 +++++ integration_tests/dbt_project.yml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a04da9..e23e82e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# dbt_salesforce v0.7.2 +## Features + - Add all model variables to the README "Disabling Models" section + - Remove variables from package's `dbt_project.yml` to avoid conflict with a user's settings when using the package. + # dbt_salesforce v0.7.1 ## Features - Resolving bug in `salesforce__contact_enhanced` when using user passthrough columns. diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index d40b694..4cdea01 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -1,5 +1,5 @@ name: 'salesforce_integration_tests' -version: '0.7.1' +version: '0.7.2' config-version: 2 profile: 'integration_tests' From fe3827babc52d9b42d1560cb2499e1b4402bbe22 Mon Sep 17 00:00:00 2001 From: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com> Date: Mon, 26 Sep 2022 13:08:58 -0500 Subject: [PATCH 3/6] update changelog --- CHANGELOG.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e23e82e..23263a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,9 @@ # dbt_salesforce v0.7.2 -## Features +PR [#35](https://github.com/fivetran/dbt_salesforce/pull/35) incorporates the following updates: +## Bug Fixes - Add all model variables to the README "Disabling Models" section - - Remove variables from package's `dbt_project.yml` to avoid conflict with a user's settings when using the package. + - Remove model variables from this package's `dbt_project.yml` to avoid potential conflict with a user's settings. + # dbt_salesforce v0.7.1 ## Features From ee074a85f68fff1654dfef12593964119aacedba Mon Sep 17 00:00:00 2001 From: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com> Date: Mon, 26 Sep 2022 17:41:08 -0500 Subject: [PATCH 4/6] update readme and requirements --- README.md | 10 ---------- integration_tests/requirements.txt | 12 ++++++------ 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index c98bab3..0265669 100644 --- a/README.md +++ b/README.md @@ -63,11 +63,6 @@ packages: By default, this package will run using your target database and the `salesforce` schema. If this is not where your Salesforce data is, add the following configuration to your root `dbt_project.yml` file: ```yml -# dbt_project.yml - -... -config-version: 2 - vars: salesforce_database: your_database_name salesforce_schema: your_schema_name @@ -79,11 +74,6 @@ It is possible that your Salesforce connector does not sync every table that thi To disable the corresponding functionality in this package, you must add the corresponding variable(s) to your `dbt_project.yml`, which are listed below. By default, that is if none of these variables are added, all variables are assumed to be true. Add variables only for the tables you would like to disable: ```yml -# dbt_project.yml - -... -config-version: 2 - vars: salesforce__user_role_enabled: false # Disable if you do not have the user_role table salesforce__lead_enabled: false # Disable if you do not have the lead table diff --git a/integration_tests/requirements.txt b/integration_tests/requirements.txt index 89c6ccb..13d7a46 100644 --- a/integration_tests/requirements.txt +++ b/integration_tests/requirements.txt @@ -1,6 +1,6 @@ -dbt-snowflake~=1.0.0 -dbt-bigquery~=1.0.0 -dbt-redshift~=1.0.0 -dbt-postgres~=1.0.0 -dbt-spark~=1.0.0 -dbt-spark[PyHive]~=1.0.0 +dbt-snowflake~=1.2.0 +dbt-bigquery~=1.2.0 +dbt-redshift~=120.0 +dbt-postgres~=1.2.0 +dbt-spark~=1.2.0 +dbt-spark[PyHive]~=1.2.0 From 11b001461eb83c0c06c2a53555b2888ded13a557 Mon Sep 17 00:00:00 2001 From: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com> Date: Mon, 26 Sep 2022 17:43:11 -0500 Subject: [PATCH 5/6] update requirements --- integration_tests/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration_tests/requirements.txt b/integration_tests/requirements.txt index 13d7a46..0f361a6 100644 --- a/integration_tests/requirements.txt +++ b/integration_tests/requirements.txt @@ -1,6 +1,6 @@ dbt-snowflake~=1.2.0 dbt-bigquery~=1.2.0 -dbt-redshift~=120.0 +dbt-redshift~=1.2.0 dbt-postgres~=1.2.0 dbt-spark~=1.2.0 dbt-spark[PyHive]~=1.2.0 From 4071c5e43a9dd2fd529af648bcc23f426f7d964a Mon Sep 17 00:00:00 2001 From: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com> Date: Mon, 26 Sep 2022 17:55:49 -0500 Subject: [PATCH 6/6] update readme --- README.md | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 0265669..9e91387 100644 --- a/README.md +++ b/README.md @@ -43,8 +43,6 @@ You will need to ensure you have the following before leveraging the dbt package - If you are using Databricks you'll need to add the below to your `dbt_project.yml`. ```yml -# dbt_project.yml - dispatch: - macro_namespace: dbt_utils search_order: ['spark_utils', 'dbt_utils'] @@ -82,7 +80,6 @@ vars: salesforce__opportunity_line_item_enabled: false # Disable if you do not have the opportunity_line_item table salesforce__order_enabled: false # Disable if you do not have the order table salesforce__product_2_enabled: false # Disable if you do not have the product_2 table - ``` The corresponding metrics from the disabled tables will not populate in the downstream models. @@ -92,18 +89,12 @@ Source tables are referenced using default names. If an individual source table > IMPORTANT: See the package's source [`dbt_project.yml`](https://github.com/fivetran/dbt_salesforce_source/blob/main/dbt_project.yml) variable declarations to see the expected names. ```yml -# dbt_project.yml -... -config-version: 2 vars: ___identifier: your_table_name ``` ### Salesforce History Mode -If you have Salesforce [History Mode](https://fivetran.com/docs/getting-started/feature/history-mode) enabled for your connector, you will want to add and set the desired `using_[table]_history_mode_active_records` variable(s) as `true` to filter for only active records as the package is designed for non-historical data. These variables are disabled by default. +If you have Salesforce [History Mode](https://fivetran.com/docs/getting-started/feature/history-mode) enabled for your connector, in your `dbt_project.yml`, you will want to add and set the desired `using_[table]_history_mode_active_records` variable(s) as `true` to filter for only active records as the package is designed for non-historical data. These variables are disabled by default. ```yml -# dbt_project.yml - -... vars: using_account_history_mode_active_records: true # false by default. Only use if you have history mode enabled. using_opportunity_history_mode_active_records: true # false by default. Only use if you have history mode enabled. @@ -126,14 +117,11 @@ models: +schema: my_new_schema_name # leave blank for just the target_schema ``` ### Adding Passthrough Columns -This package allows users to add additional columns to the `opportunity enhanced` model and `contact enhanced` model. For the `opportunity enhanced` model, columns passed through in `opportunity_enhanced_pass_through_columns` must also be present in the upstream source `opportunity`, `account`, `user`, or `user_role` table. If you want to include a column from the `user` table, you must specify if you want it to be a field related to the opportunity_manager or opportunity_owner. +This package allows users to add additional columns to the `opportunity enhanced` model and `contact enhanced` model by using the below variables in you `dbt_project.yml` file. For the `opportunity enhanced` model, columns passed through in `opportunity_enhanced_pass_through_columns` must also be present in the upstream source `opportunity`, `account`, `user`, or `user_role` table. If you want to include a column from the `user` table, you must specify if you want it to be a field related to the opportunity_manager or opportunity_owner. Additionally, you may add additional columns to the staging models. For example, for passing columns to `stg_salesforce__product_2` you would need to configure `product_2_pass_through_columns`. ```yml -# dbt_project.yml - -... vars: opportunity_enhanced_pass_through_columns: [account_custom_field_1, my_opp_custom_field, user_role_custom_field_1, opportunity_manager.user_custom_column_1] account_pass_through_columns: [account_custom_field_1, account_custom_field_2]