Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update partition logic with source relation #74

Merged
merged 4 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: 'auto release'
on:
pull_request:
types:
- closed
branches:
- main

jobs:
call-workflow-passing-data:
if: github.event.pull_request.merged
uses: fivetran/dbt_package_automations/.github/workflows/auto-release.yml@main
secrets: inherit
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ target/
dbt_modules/
logs/
env/
dbt_packages/
dbt_packages/
package-lock.yml
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# dbt_shopify v0.11.0
[PR #74](https://github.com/fivetran/dbt_shopify/pull/74) includes the following updates:

## 🚨 Breaking Changes 🚨
- Added `source_relation` to the `partition_by` clauses that determine the `customer_index` in the `int_shopify__customer_email_rollup` table. If the user is leveraging the union feature, this could change data values.

## 🚘 Under The Hood 🚘
- Included auto-releaser GitHub Actions workflow to automate future releases.
- Added additional casting in seed dependencies for above models `integration_tests/dbt_project.yml` to ensure local testing passed on null cases.

# dbt_shopify v0.10.0
## 🚨 Breaking Changes 🚨
- This release will be a breaking change due to the removal of below dependencies.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ If you are **not** using the [Shopify Holistic reporting package](https://github
```yml
packages:
- package: fivetran/shopify
version: [">=0.10.0", "<0.11.0"] # we recommend using ranges to capture non-breaking changes automatically
version: [">=0.11.0", "<0.12.0"] # we recommend using ranges to capture non-breaking changes automatically
```

Do **NOT** include the `shopify_source` package in this file. The transformation package itself has a dependency on it and will install the source package as well.
Expand Down Expand Up @@ -205,7 +205,7 @@ This dbt package is dependent on the following dbt packages. Please be aware tha
```yml
packages:
- package: fivetran/shopify_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,5 +1,5 @@
name: 'shopify'
version: '0.10.0'
version: '0.11.0'
config-version: 2
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.

4 changes: 2 additions & 2 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.

10 changes: 9 additions & 1 deletion integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'shopify_integration_tests'
version: '0.10.0'
version: '0.11.0'
profile: 'integration_tests'
config-version: 2

Expand Down Expand Up @@ -117,9 +117,14 @@ seeds:
user_id: "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"
shopify_abandoned_checkout_discount_code_data:
+column_types:
checkout_id: "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"
discount_id: "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"
amount: float
_fivetran_synced: timestamp
created_at: timestamp
updated_at: timestamp
code: "{{ 'string' if target.type in ('bigquery', 'spark', 'databricks') else 'varchar' }}"
type: "{{ 'string' if target.type in ('bigquery', 'spark', 'databricks') else 'varchar' }}"
shopify_abandoned_checkout_data:
+column_types:
total_line_items_price: float
Expand Down Expand Up @@ -156,6 +161,9 @@ seeds:
+column_types:
value_type: "{{ 'string' if target.type in ('bigquery', 'spark', 'databricks') else 'varchar' }}"
type: "{{ 'string' if target.type in ('bigquery', 'spark', 'databricks') else 'varchar' }}"
_fivetran_synced: timestamp
created_at: timestamp
updated_at: timestamp
shopify_shop_data:
+column_types:
taxes_included: boolean
Expand Down
2 changes: 1 addition & 1 deletion models/intermediate/int_shopify__customer_email_rollup.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ with customers as (

select
*,
row_number() over(partition by email order by created_timestamp desc) as customer_index
row_number() over(partition by email, source_relation order by created_timestamp desc) as customer_index

from {{ var('shopify_customer') }}
where email is not null -- nonsensical to include any null emails here
Expand Down
7 changes: 5 additions & 2 deletions packages.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
packages:
- package: fivetran/shopify_source
version: [">=0.10.0", "<0.11.0"]
# - package: fivetran/shopify_source
# version: [">=0.10.0", "<0.11.0"]
- git: https://github.com/fivetran/dbt_shopify_source.git
revision: bugfix/update-partition-logic-add-source-relation
warn-unpinned: false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reminder to swap before merge