Skip to content

Commit

Permalink
Merge pull request #44 from fivetran/bugfix/update-date-spine-variabl…
Browse files Browse the repository at this point in the history
…e-logic

Update date spine variable logic
  • Loading branch information
fivetran-avinash authored Oct 3, 2023
2 parents 2cc0124 + 1637195 commit 099a952
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 19 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ logs/
keyfile.json
.DS_Store
develop/
dbt_packages/
dbt_packages/
env/
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ Please note that this data model will now create a new transformation for **all*

If you are not already a Quickstart Data Model user, you can find out more information [here](https://fivetran.com/docs/transformations/quickstart)!

# dbt_salesforce v0.9.3
## 🪲 Bug Fix ⚒️
[PR #44](https://github.com/fivetran/dbt_salesforce/pull/44) introduces the following update:

- Updated the `first_date_query` logic in `int_salesforce__date_spine` to select first date from the minimum `created_date` on the `opportunity` source when the `lead` source is not available.

# dbt_salesforce v0.9.2
## Documentation and Notice Updates
[PR #42](https://github.com/fivetran/dbt_salesforce/pull/42) includes the following update:
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: 'salesforce'
version: '0.9.2'
version: '0.9.3'
require-dbt-version: [">=1.3.0", "<2.0.0"]
models:
salesforce:
Expand Down
2 changes: 1 addition & 1 deletion docs/catalog.json

Large diffs are not rendered by default.

24 changes: 12 additions & 12 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

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,5 +1,5 @@
name: 'salesforce_integration_tests'
version: '0.9.2'
version: '0.9.3'
config-version: 2

profile: 'integration_tests'
Expand Down
8 changes: 7 additions & 1 deletion models/intermediate/int_salesforce__date_spine.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ with spine as (

{% if execute %}
{% set first_date_query %}
select min( created_date ) as min_date from {{ source('salesforce', 'lead') }}
{% if var('salesforce__lead_enabled', True) %}
select min( created_date ) as min_date from {{ source('salesforce', 'lead') }}

{% else %}
select min( created_date ) as min_date from {{ source('salesforce', 'opportunity') }}
{% endif %}

{% endset %}
{% set first_date = run_query(first_date_query).columns[0][0]|string %}

Expand Down

0 comments on commit 099a952

Please sign in to comment.