Skip to content

Commit

Permalink
Merge pull request #96 from fivetran/enhancement/deprecation-full-sta…
Browse files Browse the repository at this point in the history
…tement-false-documentation

Enhancement: Add deprecation full_statement_version=false documentation & warning log
  • Loading branch information
fivetran-avinash authored Aug 9, 2023
2 parents c4ad9bf + 1f21f52 commit 4f0e2e7
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 11 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# dbt_salesforce_formula_utils v0.9.2
[PR #96](https://github.com/fivetran/dbt_salesforce_formula_utils/pull/96) includes the following updates:

## 🗒️ Documentation Update 🗒️
- Fivetran will be deprecating support for the `full_statement_version=false` config by October 1, 2023. We've highlighted this change to users of the package [in the README](https://github.com/fivetran/dbt_salesforce_formula_utils#step-4-create-models).

## 🚇 Under the Hood 🚇
- Users still utilizing the `full_statement_version=false` config will receive a log message in their `dbt run` indicating deprecation of support for those options.

# dbt_salesforce_formula_utils v0.9.1
## Bugfix
- Databricks users faced a syntax error resulting from the `sfdc_formula_view_sql` macro not correctly compiling. This update adds the Databricks warehouse to a conditional in the macro that allows the sql to correctly compile. ([PR #94](https://github.com/fivetran/dbt_salesforce_formula_utils/pull/94)) ([PR #92](https://github.com/fivetran/dbt_salesforce_formula_utils/pull/92))
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ If you would like your model to generate all the formula fields at once related

> This option makes use of the `fivetran_formula_model` lookup table, which stores connector-generated SQL queries for each source table. Compared to `fivetran_formula`, which is used in Options 2 & 3, it is typically more complete and supports most double-nested formulas.


### (Deprecated) Options 2 and 3

**IMPORTANT**: Options 2 and 3 (which leverage the `full_statement_version=false` config) will no longer be supported after October 1. Click 'Expand to view details' if you'd like to still use these options for the time being.

<details>
<summary>Expand to view details</summary>

### Option 2: Generate all relevant formula fields using package-made query

If you would like your model to generate all the formula fields related to your source table then you will need to:
Expand Down Expand Up @@ -102,6 +110,8 @@ If you would like your model to generate only a specified subset of your formula
**Output**: Only formulas provided in the `fields_to_include` variable will be included in the resulting `select` statement for the chosen source table.

> This option makes use of the `fivetran_formula` lookup table, which requires the package to combine fields' formulas into a SQL query for each source table. This option does not support double-nested formulas and therefore may be incomplete compared to Option #1.
</details>
<br/>

### Automate model creation
If you have multiple models you need to create, you can also leverage the [sfdc_formula_model_automation](https://github.com/fivetran/dbt_salesforce_formula_utils#sfdc_formula_model_automationsh-source) script within this project to automatically create models locally via the command line. Below is an example command to copy and edit.
Expand Down
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'salesforce_formula_utils'
version: '0.9.1'
version: '0.9.2'
config-version: 2
require-dbt-version: [">=1.3.0", "<2.0.0"]
2 changes: 1 addition & 1 deletion docs/catalog.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions docs/index.html

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
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v4.json", "dbt_version": "1.4.5", "generated_at": "2023-07-25T19:12:54.432187Z", "invocation_id": "5a5f5939-8b79-44c3-960d-ba2ed80338bf", "env": {}}, "results": [], "elapsed_time": 0.0, "args": {"write_json": true, "use_colors": true, "printer_width": 80, "version_check": true, "partial_parse": true, "static_parser": true, "profiles_dir": "/Users/renee.li/.dbt", "send_anonymous_usage_stats": true, "quiet": false, "no_print": false, "cache_selected_only": false, "compile": true, "which": "generate", "rpc_method": "docs.generate", "indirect_selection": "eager"}}
{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v4.json", "dbt_version": "1.6.0", "generated_at": "2023-08-08T18:22:11.186335Z", "invocation_id": "d8d7e46d-bb6d-45da-9073-0acc06c08d7d", "env": {}}, "results": [{"status": "success", "timing": [{"name": "compile", "started_at": "2023-08-08T18:22:07.250768Z", "completed_at": "2023-08-08T18:22:08.480834Z"}, {"name": "execute", "started_at": "2023-08-08T18:22:08.481482Z", "completed_at": "2023-08-08T18:22:08.481495Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 1.373094081878662, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce_formula_integration_tests.opportunity_statement_view"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-08-08T18:22:07.222813Z", "completed_at": "2023-08-08T18:22:08.538275Z"}, {"name": "execute", "started_at": "2023-08-08T18:22:08.538712Z", "completed_at": "2023-08-08T18:22:08.538719Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 1.4241516590118408, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce_formula_integration_tests.account_statement_view"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-08-08T18:22:07.244739Z", "completed_at": "2023-08-08T18:22:09.106983Z"}, {"name": "execute", "started_at": "2023-08-08T18:22:09.107886Z", "completed_at": "2023-08-08T18:22:09.107890Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 1.9921491146087646, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce_formula_integration_tests.account_view"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-08-08T18:22:07.253191Z", "completed_at": "2023-08-08T18:22:09.106538Z"}, {"name": "execute", "started_at": "2023-08-08T18:22:09.107644Z", "completed_at": "2023-08-08T18:22:09.107651Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 1.9913380146026611, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce_formula_integration_tests.opportunity_view"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-08-08T18:22:08.595152Z", "completed_at": "2023-08-08T18:22:09.630925Z"}, {"name": "execute", "started_at": "2023-08-08T18:22:09.631761Z", "completed_at": "2023-08-08T18:22:09.631772Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 1.1709909439086914, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce_formula_integration_tests.user_role_statement_view"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-08-08T18:22:09.768798Z", "completed_at": "2023-08-08T18:22:09.770075Z"}, {"name": "execute", "started_at": "2023-08-08T18:22:09.770650Z", "completed_at": "2023-08-08T18:22:09.770656Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.003179788589477539, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.salesforce_formula_integration_tests.account"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-08-08T18:22:09.772465Z", "completed_at": "2023-08-08T18:22:09.773502Z"}, {"name": "execute", "started_at": "2023-08-08T18:22:09.774122Z", "completed_at": "2023-08-08T18:22:09.774128Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.0027687549591064453, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.salesforce_formula_integration_tests.fivetran_formula"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-08-08T18:22:09.776432Z", "completed_at": "2023-08-08T18:22:09.777499Z"}, {"name": "execute", "started_at": "2023-08-08T18:22:09.778018Z", "completed_at": "2023-08-08T18:22:09.778023Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.0028531551361083984, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.salesforce_formula_integration_tests.fivetran_formula_model"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-08-08T18:22:09.779916Z", "completed_at": "2023-08-08T18:22:09.782677Z"}, {"name": "execute", "started_at": "2023-08-08T18:22:09.783532Z", "completed_at": "2023-08-08T18:22:09.783539Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.004770040512084961, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.salesforce_formula_integration_tests.opportunity"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-08-08T18:22:09.785640Z", "completed_at": "2023-08-08T18:22:09.786663Z"}, {"name": "execute", "started_at": "2023-08-08T18:22:09.787186Z", "completed_at": "2023-08-08T18:22:09.787191Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.0027370452880859375, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.salesforce_formula_integration_tests.user"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-08-08T18:22:09.788996Z", "completed_at": "2023-08-08T18:22:09.790030Z"}, {"name": "execute", "started_at": "2023-08-08T18:22:09.790567Z", "completed_at": "2023-08-08T18:22:09.790572Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.0026640892028808594, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.salesforce_formula_integration_tests.user_role"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-08-08T18:22:08.644893Z", "completed_at": "2023-08-08T18:22:10.342413Z"}, {"name": "execute", "started_at": "2023-08-08T18:22:10.344144Z", "completed_at": "2023-08-08T18:22:10.344151Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 1.8221628665924072, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce_formula_integration_tests.user_role_view"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-08-08T18:22:09.215875Z", "completed_at": "2023-08-08T18:22:10.473646Z"}, {"name": "execute", "started_at": "2023-08-08T18:22:10.474227Z", "completed_at": "2023-08-08T18:22:10.474234Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 1.4106402397155762, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce_formula_integration_tests.user_statement_view"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2023-08-08T18:22:09.218488Z", "completed_at": "2023-08-08T18:22:11.014836Z"}, {"name": "execute", "started_at": "2023-08-08T18:22:11.016231Z", "completed_at": "2023-08-08T18:22:11.016247Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 1.9671101570129395, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce_formula_integration_tests.user_view"}], "elapsed_time": 7.32912802696228, "args": {"cache_selected_only": false, "profiles_dir": "/Users/avinash.kunnath/.dbt", "send_anonymous_usage_stats": true, "exclude": [], "static_parser": true, "use_colors": true, "log_level_file": "debug", "vars": {}, "log_path": "/Users/avinash.kunnath/Documents/dbt_packages/salesforce_formula_utils/dbt_salesforce_formula_utils/integration_tests/logs", "print": true, "target": "postgres", "log_format_file": "debug", "log_level": "info", "introspect": true, "version_check": true, "macro_debugging": false, "which": "generate", "write_json": true, "log_file_max_bytes": 10485760, "select": [], "quiet": false, "strict_mode": false, "enable_legacy_logger": false, "use_colors_file": true, "compile": true, "printer_width": 80, "indirect_selection": "eager", "populate_cache": true, "partial_parse": true, "empty_catalog": false, "favor_state": false, "log_format": "default", "warn_error_options": {"include": [], "exclude": []}, "defer": false, "invocation_command": "dbt docs generate -t postgres", "project_dir": "/Users/avinash.kunnath/Documents/dbt_packages/salesforce_formula_utils/dbt_salesforce_formula_utils/integration_tests"}}
2 changes: 1 addition & 1 deletion integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'salesforce_formula_integration_tests'
version: '0.9.1'
version: '0.9.2'
profile: 'integration_tests'
config-version: 2
vars:
Expand Down
4 changes: 3 additions & 1 deletion macros/sfdc_formula_view.sql
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
-- defaults to all formula fields if fields_to_include is none
{% if fields_to_include is none %}
{% set fields_to_include = current_formula_fields | lower %}
{% endif %}
{% endif %}

{{ exceptions.warn("\nWARNING, Deprecated: full_statement_version=false is no longer supported and will stop working on October 1st, 2023. Be sure to update your " ~ this.identifier|upper ~ " model to leverage full_statement_version=true before then. See https://github.com/fivetran/dbt_salesforce_formula_utils#step-4-create-models for more details.\n") }}

select

Expand Down

0 comments on commit 4f0e2e7

Please sign in to comment.