Skip to content

Commit

Permalink
Merge pull request #30 from fivetran/MagicBot_9c88de9af8
Browse files Browse the repository at this point in the history
[MagicBot] Bumping package version
  • Loading branch information
fivetran-joemarkiewicz authored Dec 22, 2021
2 parents e262987 + 863398f commit c7b95b8
Show file tree
Hide file tree
Showing 33 changed files with 113 additions and 54 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
target/
dbt_modules/
logs/

dbt_packages/
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
# dbt_shopify_source v0.6.0
🎉 dbt v1.0.0 Compatibility 🎉
## 🚨 Breaking Changes 🚨
- Adjusts the `require-dbt-version` to now be within the range [">=1.0.0", "<2.0.0"]. Additionally, the package has been updated for dbt v1.0.0 compatibility. If you are using a dbt version <1.0.0, you will need to upgrade in order to leverage the latest version of the package.
- For help upgrading your package, I recommend reviewing this GitHub repo's Release Notes on what changes have been implemented since your last upgrade.
- For help upgrading your dbt project to dbt v1.0.0, I recommend reviewing dbt-labs [upgrading to 1.0.0 docs](https://docs.getdbt.com/docs/guides/migration-guide/upgrading-to-1-0-0) for more details on what changes must be made.
- Upgrades the package dependency to refer to the latest `dbt_fivetran_utils`. The latest `dbt_fivetran_utils` package also has a dependency on `dbt_utils` [">=0.8.0", "<0.9.0"].
- Please note, if you are installing a version of `dbt_utils` in your `packages.yml` that is not in the range above then you will encounter a package dependency error.

- The `union_schemas` and `union_databases` variables have been replaced with `shopify_union_schemas` and `shopify_union_databases` respectively. This allows for multiple packages with the union ability to be used and not locked to a single variable that is used across packages.

# dbt_shopify_source v0.5.2
## Under the Hood
- Rearranged the ordering of the columns within the `get_order_columns` macro. This ensure the output of the models within the downstream [Shopify Holistic Reporting](https://github.com/fivetran/dbt_shopify_holistic_reporting) package are easier to understand and interpret. ([#29](https://github.com/fivetran/dbt_shopify_source/pull/29))

# dbt_shopify_source v0.1.0 -> v0.5.1
Refer to the relevant release notes on the Github repository for specific details for the previous releases. Thank you!
Refer to the relevant release notes on the Github repository for specific details for the previous releases. Thank you!
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Apache License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) ![dbt logo and version](https://img.shields.io/static/v1?logo=dbt&label=dbt-version&message=0.20.x&color=orange)
[![Apache License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
# Shopify (Source)

This package models Shopify data from [Fivetran's connector](https://fivetran.com/docs/applications/shopify). It uses data in the format described by [this ERD](https://fivetran.com/docs/applications/shopify#schemainformation).
Expand All @@ -24,7 +24,7 @@ Include in your `packages.yml`
```yaml
packages:
- package: fivetran/shopify_source
version: [">=0.5.0", "<0.6.0"]
version: [">=0.6.0", "<0.7.0"]
```
## Configuration
Expand All @@ -42,7 +42,7 @@ vars:
```

### Union Multiple Shopify Connectors
If you have multiple Shopify connectors in Fivetran and would like to use this package on all of them simultaneously, we have provided functionality to do so. The package will union all of the data together and pass the unioned table into the transformations. You will be able to see which source it came from in the `source_relation` column of each model. To use this functionality, you will need to set either the `union_schemas` or `union_databases` variables:
If you have multiple Shopify connectors in Fivetran and would like to use this package on all of them simultaneously, we have provided functionality to do so. The package will union all of the data together and pass the unioned table into the transformations. You will be able to see which source it came from in the `source_relation` column of each model. To use this functionality, you will need to set either the `shopify_union_schemas` or `shopify_union_databases` variables:

```yml
# dbt_project.yml
Expand All @@ -51,8 +51,8 @@ If you have multiple Shopify connectors in Fivetran and would like to use this p
config-version: 2
vars:
union_schemas: ['shopify_usa','shopify_canada'] # use this if the data is in different schemas/datasets of the same database/project
union_databases: ['shopify_usa','shopify_canada'] # use this if the data is in different databases/projects but uses the same schema name
shopify_union_schemas: ['shopify_usa','shopify_canada'] # use this if the data is in different schemas/datasets of the same database/project
shopify_union_databases: ['shopify_usa','shopify_canada'] # use this if the data is in different databases/projects but uses the same schema name
```

### Add Passthrough Columns
Expand Down
44 changes: 21 additions & 23 deletions dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@

name: 'shopify_source'
version: '0.5.2'
version: '0.6.0'
config-version: 2

require-dbt-version: ">=0.20.0"
require-dbt-version: [">=1.0.0", "<2.0.0"]

models:
models:
shopify_source:
+schema: stg_shopify
+materialized: table
Expand All @@ -14,24 +13,23 @@ models:

vars:
shopify_source:
customer_source: "{{ source('shopify','customer') }}"
order_line_refund_source: "{{ source('shopify','order_line_refund') }}"
order_line_source: "{{ source('shopify','order_line') }}"
order_source: "{{ source('shopify','order') }}"
product_source: "{{ source('shopify','product') }}"
product_variant_source: "{{ source('shopify','product_variant') }}"
transaction_source: "{{ source('shopify','transaction') }}"
refund_source: "{{ source('shopify','refund') }}"
order_adjustment_source: "{{ source('shopify','order_adjustment') }}"

customer_pass_through_columns: []
customer_source: "{{ source('shopify','customer') }}"
order_line_refund_source: "{{ source('shopify','order_line_refund') }}"
order_line_source: "{{ source('shopify','order_line') }}"
order_source: "{{ source('shopify','order') }}"
product_source: "{{ source('shopify','product') }}"
product_variant_source: "{{ source('shopify','product_variant') }}"
transaction_source: "{{ source('shopify','transaction') }}"
refund_source: "{{ source('shopify','refund') }}"
order_adjustment_source: "{{ source('shopify','order_adjustment') }}"
customer_pass_through_columns: []
order_line_refund_pass_through_columns: []
order_line_pass_through_columns: []
order_pass_through_columns: []
product_pass_through_columns: []
product_variant_pass_through_columns: []
transaction_pass_through_columns: []
order_line_pass_through_columns: []
order_pass_through_columns: []
product_pass_through_columns: []
product_variant_pass_through_columns: []
transaction_pass_through_columns: []

shopify__using_order_adjustment: True
shopify__using_order_line_refund: True
shopify__using_refund: True
shopify__using_order_adjustment: true
shopify__using_order_line_refund: true
shopify__using_refund: true
9 changes: 6 additions & 3 deletions integration_tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
dbt==0.20.1rc1
dbt-spark==0.20.1rc1
dbt-spark[PyHive]==0.20.1rc1
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
5 changes: 4 additions & 1 deletion models/stg_shopify__customer.sql
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ renamed as (

{% endif %}

{{ fivetran_utils.source_relation() }}
{{ fivetran_utils.source_relation(
union_schema_variable='shopify_union_schemas',
union_database_variable='shopify_union_databases')
}}

from source

Expand Down
5 changes: 4 additions & 1 deletion models/stg_shopify__order.sql
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ renamed as (

{% endif %}

{{ fivetran_utils.source_relation() }}
{{ fivetran_utils.source_relation(
union_schema_variable='shopify_union_schemas',
union_database_variable='shopify_union_databases')
}}

from source

Expand Down
5 changes: 4 additions & 1 deletion models/stg_shopify__order_adjustment.sql
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ renamed as (
)
}}

{{ fivetran_utils.source_relation() }}
{{ fivetran_utils.source_relation(
union_schema_variable='shopify_union_schemas',
union_database_variable='shopify_union_databases')
}}

from source
)
Expand Down
5 changes: 4 additions & 1 deletion models/stg_shopify__order_line.sql
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ renamed as (

{% endif %}

{{ fivetran_utils.source_relation() }}
{{ fivetran_utils.source_relation(
union_schema_variable='shopify_union_schemas',
union_database_variable='shopify_union_databases')
}}

from source

Expand Down
5 changes: 4 additions & 1 deletion models/stg_shopify__order_line_refund.sql
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ renamed as (

{% endif %}

{{ fivetran_utils.source_relation() }}
{{ fivetran_utils.source_relation(
union_schema_variable='shopify_union_schemas',
union_database_variable='shopify_union_databases')
}}

from source

Expand Down
5 changes: 4 additions & 1 deletion models/stg_shopify__product.sql
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ renamed as (

{% endif %}

{{ fivetran_utils.source_relation() }}
{{ fivetran_utils.source_relation(
union_schema_variable='shopify_union_schemas',
union_database_variable='shopify_union_databases')
}}

from source

Expand Down
5 changes: 4 additions & 1 deletion models/stg_shopify__product_variant.sql
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ renamed as (

{% endif %}

{{ fivetran_utils.source_relation() }}
{{ fivetran_utils.source_relation(
union_schema_variable='shopify_union_schemas',
union_database_variable='shopify_union_databases')
}}

from source

Expand Down
5 changes: 4 additions & 1 deletion models/stg_shopify__refund.sql
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ renamed as (
)
}}

{{ fivetran_utils.source_relation() }}
{{ fivetran_utils.source_relation(
union_schema_variable='shopify_union_schemas',
union_database_variable='shopify_union_databases')
}}

from source
)
Expand Down
5 changes: 4 additions & 1 deletion models/stg_shopify__transaction.sql
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ renamed as (

{% endif %}

{{ fivetran_utils.source_relation() }}
{{ fivetran_utils.source_relation(
union_schema_variable='shopify_union_schemas',
union_database_variable='shopify_union_databases')
}}

from source
where not test
Expand Down
4 changes: 3 additions & 1 deletion models/tmp/stg_shopify__customer_tmp.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
schema_variable='shopify_schema',
default_database=target.database,
default_schema='shopify',
default_variable='customer_source'
default_variable='customer_source',
union_schema_variable='shopify_union_schemas',
union_database_variable='shopify_union_databases'
)
}}
4 changes: 3 additions & 1 deletion models/tmp/stg_shopify__order_adjustment_tmp.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
schema_variable='shopify_schema',
default_database=target.database,
default_schema='shopify',
default_variable='order_adjustment_source'
default_variable='order_adjustment_source',
union_schema_variable='shopify_union_schemas',
union_database_variable='shopify_union_databases'
)
}}
4 changes: 3 additions & 1 deletion models/tmp/stg_shopify__order_line_refund_tmp.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
schema_variable='shopify_schema',
default_database=target.database,
default_schema='shopify',
default_variable='order_line_refund_source'
default_variable='order_line_refund_source',
union_schema_variable='shopify_union_schemas',
union_database_variable='shopify_union_databases'
)
}}
4 changes: 3 additions & 1 deletion models/tmp/stg_shopify__order_line_tmp.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
schema_variable='shopify_schema',
default_database=target.database,
default_schema='shopify',
default_variable='order_line_source'
default_variable='order_line_source',
union_schema_variable='shopify_union_schemas',
union_database_variable='shopify_union_databases'
)
}}
4 changes: 3 additions & 1 deletion models/tmp/stg_shopify__order_tmp.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
schema_variable='shopify_schema',
default_database=target.database,
default_schema='shopify',
default_variable='order_source'
default_variable='order_source',
union_schema_variable='shopify_union_schemas',
union_database_variable='shopify_union_databases'
)
}}
4 changes: 3 additions & 1 deletion models/tmp/stg_shopify__product_tmp.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
schema_variable='shopify_schema',
default_database=target.database,
default_schema='shopify',
default_variable='product_source'
default_variable='product_source',
union_schema_variable='shopify_union_schemas',
union_database_variable='shopify_union_databases'
)
}}
4 changes: 3 additions & 1 deletion models/tmp/stg_shopify__product_variant_tmp.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
schema_variable='shopify_schema',
default_database=target.database,
default_schema='shopify',
default_variable='product_variant_source'
default_variable='product_variant_source',
union_schema_variable='shopify_union_schemas',
union_database_variable='shopify_union_databases'
)
}}
4 changes: 3 additions & 1 deletion models/tmp/stg_shopify__refund_tmp.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
schema_variable='shopify_schema',
default_database=target.database,
default_schema='shopify',
default_variable='refund_source'
default_variable='refund_source',
union_schema_variable='shopify_union_schemas',
union_database_variable='shopify_union_databases'
)
}}
4 changes: 3 additions & 1 deletion models/tmp/stg_shopify__transaction_tmp.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
schema_variable='shopify_schema',
default_database=target.database,
default_schema='shopify',
default_variable='transaction_source'
default_variable='transaction_source',
union_schema_variable='shopify_union_schemas',
union_database_variable='shopify_union_databases'
)
}}
8 changes: 4 additions & 4 deletions packages.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
packages:
- package: fivetran/fivetran_utils
version: [">=0.2.0", "<0.3.0"]
- package: dbt-labs/spark_utils
version: [">=0.2.0", "<0.3.0"]
- package: fivetran/fivetran_utils
version: [">=0.3.0", "<0.4.0"]
- package: dbt-labs/spark_utils
version: [">=0.3.0", "<0.4.0"]

0 comments on commit c7b95b8

Please sign in to comment.