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

the big revamp PR! #52

Merged
merged 163 commits into from
Jan 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
163 commits
Select commit Hold shift + click to select a range
a73f838
add changelog
fivetran-reneeli May 13, 2022
75b86e1
update readme
fivetran-reneeli May 13, 2022
71f3a3a
update versioining
fivetran-reneeli May 13, 2022
fee26cc
clean
fivetran-reneeli May 13, 2022
c11641f
Merge branch 'main' into feature/package_updates
fivetran-reneeli May 13, 2022
a278cc4
add idenfier var
fivetran-reneeli May 13, 2022
9b3d562
Merge branch 'feature/package_updates' of https://github.com/fivetran…
fivetran-reneeli May 13, 2022
7cec3be
schema var
fivetran-reneeli May 16, 2022
abd5ed7
try
fivetran-reneeli May 17, 2022
af563a2
revert
fivetran-reneeli May 18, 2022
f35c2b1
order fix
fivetran-reneeli May 18, 2022
254dad0
add column to seed
fivetran-reneeli May 18, 2022
22a5012
try order table fix
fivetran-reneeli May 18, 2022
487da60
Update dbt_project.yml
fivetran-joemarkiewicz May 18, 2022
3c2b17a
fix
fivetran-reneeli May 18, 2022
f5a17d7
revert back orders
fivetran-reneeli May 18, 2022
79544d9
new schema
fivetran-reneeli May 18, 2022
613acff
fix order data
fivetran-reneeli May 18, 2022
f891ed4
Update CHANGELOG.md
fivetran-reneeli May 19, 2022
6d52968
Update README.md
fivetran-reneeli May 19, 2022
71847f0
Update README.md
fivetran-reneeli May 19, 2022
72f4f37
docs
fivetran-reneeli May 19, 2022
1097856
merging
fivetran-jamie Dec 1, 2022
25cc4fd
Merge pull request #33 from fivetran/feature/package_updates
fivetran-jamie Dec 1, 2022
f8d977e
integration tests
fivetran-jamie Dec 1, 2022
bf978fd
Readme updates
fivetran-jamie Dec 1, 2022
930fcf4
readme
fivetran-jamie Dec 1, 2022
261f34a
adding new staging models and documenting
fivetran-jamie Dec 3, 2022
4d2d8a5
more tables
fivetran-jamie Dec 6, 2022
b96e2b7
staging models are added
fivetran-jamie Dec 7, 2022
fdf9822
docs
fivetran-jamie Dec 7, 2022
c5ebc4b
all new tables are documentted and tested
fivetran-jamie Dec 8, 2022
e2c6446
new fields added but not documented
fivetran-jamie Dec 8, 2022
9d2878e
buildkite
fivetran-jamie Dec 8, 2022
3ac8c38
seeds
fivetran-jamie Dec 8, 2022
746c058
seeds
fivetran-jamie Dec 8, 2022
9440712
int out of range
fivetran-jamie Dec 8, 2022
b0cbd90
int out of range
fivetran-jamie Dec 8, 2022
e810268
uhhhhh
fivetran-jamie Dec 8, 2022
956e930
integration tests
fivetran-jamie Dec 8, 2022
329ebd3
data types
fivetran-jamie Dec 8, 2022
b7151ad
postgres and redshift
fivetran-jamie Dec 8, 2022
0657333
databricks
fivetran-jamie Dec 8, 2022
110cbc9
fields seelction
fivetran-jamie Dec 9, 2022
785c2ee
lotsa work
fivetran-jamie Dec 13, 2022
2fbc84e
one more changelog thing
fivetran-jamie Dec 13, 2022
0ae9d60
order identifier
fivetran-jamie Dec 13, 2022
26dfc01
revert
fivetran-jamie Dec 13, 2022
fa12236
changelog
fivetran-jamie Dec 13, 2022
74ed078
Merge pull request #38 from fivetran/feature/revamp/style-updates-and…
fivetran-jamie Dec 13, 2022
ffd0725
renee feedback
fivetran-jamie Dec 13, 2022
0e1df17
merged figvetran utils
fivetran-jamie Dec 13, 2022
ac8c50e
buildkite
fivetran-jamie Dec 14, 2022
5650524
change yml to capture field changes
fivetran-jamie Dec 14, 2022
714f26b
buildkite
fivetran-jamie Dec 14, 2022
08c5618
databricks
fivetran-jamie Dec 14, 2022
0def2e3
docs
fivetran-jamie Dec 14, 2022
17aedd2
Refunds explanation
fivetran-jamie Dec 14, 2022
33594d3
Merge branch 'feature/package-revamp' into feature/revamp/new-tables
fivetran-jamie Dec 14, 2022
76d898f
Merge branch 'feature/package-revamp' into feature/revamp/update-fiel…
fivetran-jamie Dec 14, 2022
6e2c05b
Merge pull request #40 from fivetran/feature/revamp/update-field-sele…
fivetran-jamie Dec 14, 2022
a89bd2d
cast timestamps explicitly for old models
fivetran-jamie Dec 14, 2022
d15704b
databricks needs new schema
fivetran-jamie Dec 14, 2022
9a1f0ae
Merge branch 'feature/revamp/new-tables' of https://github.com/fivetr…
fivetran-jamie Dec 14, 2022
a10c8ff
Merge branch 'feature/package-revamp' into feature/revamp/new-tables
fivetran-jamie Dec 14, 2022
cd307dc
Merge pull request #39 from fivetran/feature/revamp/new-tables
fivetran-jamie Dec 14, 2022
55c52f6
some docs
fivetran-jamie Dec 15, 2022
36d38b7
test buildkite on one table
fivetran-jamie Dec 16, 2022
1e6158a
fix seeds
fivetran-jamie Dec 16, 2022
0c5044f
fix schema
fivetran-jamie Dec 16, 2022
779cceb
Fix buiodkite schema
fivetran-jamie Dec 16, 2022
ab89daf
anoter schema
fivetran-jamie Dec 16, 2022
dfdb543
use doiff schema
fivetran-jamie Dec 16, 2022
00906d6
Merge branch 'feature/package-revamp' of https://github.com/fivetran/…
fivetran-jamie Dec 16, 2022
10efb1b
use dbt date macro
fivetran-jamie Dec 16, 2022
3f147f0
redme weak
fivetran-jamie Dec 16, 2022
2bda52e
add different timezone to buildkite script
fivetran-jamie Dec 16, 2022
a795ee8
changelg
fivetran-jamie Dec 16, 2022
389355b
add dbt date to dependcy matrix
fivetran-jamie Dec 19, 2022
2647cb1
Update CHANGELOG.md
fivetran-jamie Dec 20, 2022
63a9b1e
Merge pull request #41 from fivetran/feature/revamp/convert-timezones
fivetran-jamie Dec 20, 2022
6d86cd5
reverting due to too many downstream consequences
fivetran-jamie Dec 28, 2022
cfabfb9
Merge pull request #42 from fivetran/feature/revamp/revert-timestamp-…
fivetran-jamie Dec 28, 2022
7d46536
docs and style ipdates
fivetran-jamie Dec 29, 2022
d1c1f49
merge conflict
fivetran-jamie Dec 29, 2022
5c8ea43
working branch for transform updates downstream
fivetran-jamie Jan 4, 2023
8099bd1
more lowercasing
fivetran-jamie Jan 4, 2023
e2f5748
order line refund work
fivetran-jamie Jan 6, 2023
f274718
joe feedback
fivetran-jamie Jan 6, 2023
36cfb41
Merge pull request #45 from fivetran/feature/revamp/transform-enhance…
fivetran-jamie Jan 9, 2023
be87671
adding new table and work from other branches
fivetran-jamie Jan 9, 2023
315e9c4
merging
fivetran-jamie Jan 9, 2023
2e02697
buildkite
fivetran-jamie Jan 9, 2023
17ac3b6
buildkite try 2
fivetran-jamie Jan 9, 2023
4b70ff0
buildkite'
fivetran-jamie Jan 9, 2023
7a7f60a
working
fivetran-jamie Jan 9, 2023
4f403a3
buildkite seeds
fivetran-jamie Jan 10, 2023
1752768
addeded discount code does_table_exist logic
fivetran-jamie Jan 11, 2023
5c63690
updated passthrough column docs
fivetran-jamie Jan 11, 2023
bd3e29a
joe feedback
fivetran-jamie Jan 11, 2023
6279e49
test severtiy
fivetran-jamie Jan 11, 2023
7d548c9
test severity and note
fivetran-jamie Jan 11, 2023
f9b43f7
Merge pull request #47 from fivetran/feature/revamp/transform-enhance…
fivetran-jamie Jan 11, 2023
0159616
docs
fivetran-jamie Jan 12, 2023
1df74da
fulfillment event table added
fivetran-jamie Jan 14, 2023
c2ddd5b
feature/metafields
fivetran-joemarkiewicz Jan 23, 2023
ce0957d
macro typo
fivetran-jamie Jan 23, 2023
41d2bb4
Seeds
fivetran-jamie Jan 23, 2023
b7865d3
make variable names consisgtent
fivetran-jamie Jan 24, 2023
8fda519
dbt-expectations addition
fivetran-joemarkiewicz Jan 24, 2023
3809824
add tax line and new columns
fivetran-jamie Jan 24, 2023
7945295
Merge pull request #49 from fivetran/feature/metafields
fivetran-joemarkiewicz Jan 24, 2023
68eda04
Merge pull request #48 from fivetran/feature/revamp/upstream-daily-sh…
fivetran-jamie Jan 25, 2023
7b39107
Merge branch 'feature/package-revamp' of https://github.com/fivetran/…
fivetran-jamie Jan 25, 2023
10e50fc
docs and other tweaks
fivetran-jamie Jan 26, 2023
09e0a75
put source_relation in docs.md here for now"
fivetran-jamie Jan 26, 2023
2b2a527
update yml
fivetran-catfritz Jan 26, 2023
cbbd82a
update yml
fivetran-catfritz Jan 27, 2023
5c6b655
docs
fivetran-jamie Jan 27, 2023
2b0b905
update ymls
fivetran-catfritz Jan 27, 2023
4c8c945
columns and tables mostly documented
fivetran-jamie Jan 27, 2023
dc5b7a6
update ymls
fivetran-catfritz Jan 27, 2023
7316949
columns and tables compete
fivetran-jamie Jan 27, 2023
167c33b
hcangelog
fivetran-jamie Jan 27, 2023
1ba8a61
Readme
fivetran-jamie Jan 27, 2023
c00e482
udpate package version
fivetran-jamie Jan 27, 2023
5991109
specificy currencies everywhere
fivetran-jamie Jan 27, 2023
5533369
reformat changelog
fivetran-jamie Jan 28, 2023
b351490
Docs
fivetran-jamie Jan 28, 2023
b5dec02
buildkite
fivetran-jamie Jan 28, 2023
7a84a20
update ymls
fivetran-catfritz Jan 28, 2023
42cf156
Merge branch 'feature/revamp/add-tax-line' into feature/revamp/update…
fivetran-catfritz Jan 28, 2023
4748fd6
update yml
fivetran-catfritz Jan 28, 2023
9b6056f
update yml
fivetran-catfritz Jan 28, 2023
61a60b7
update yml
fivetran-catfritz Jan 30, 2023
458f3f2
update yml
fivetran-catfritz Jan 30, 2023
48868f5
update yml
fivetran-catfritz Jan 30, 2023
ab3bee2
Merge pull request #51 from fivetran/feature/revamp/update-for-snowflake
fivetran-jamie Jan 30, 2023
3b7d025
Typos
fivetran-jamie Jan 30, 2023
3a67ab6
changelog formatting
fivetran-jamie Jan 30, 2023
6f8307f
changeloeg
fivetran-jamie Jan 30, 2023
68414f8
soruces are docmented
fivetran-jamie Jan 30, 2023
b705236
databricks buildkite
fivetran-jamie Jan 30, 2023
b4fc767
removal of minus signs in profiles
fivetran-joemarkiewicz Jan 31, 2023
f9dfcec
Merge branch 'main' into feature/package-revamp
fivetran-joemarkiewicz Jan 31, 2023
9f935a5
Update integration_tests/dbt_project.yml
fivetran-joemarkiewicz Jan 31, 2023
bb0099b
Update models/stg_shopify.yml
fivetran-jamie Jan 31, 2023
cb60d20
Update models/stg_shopify.yml
fivetran-jamie Jan 31, 2023
6eceeb2
Update models/stg_shopify.yml
fivetran-jamie Jan 31, 2023
471be5c
changelog
fivetran-jamie Jan 31, 2023
b60215e
Update models/stg_shopify.yml
fivetran-jamie Jan 31, 2023
f9b729e
Update models/stg_shopify.yml
fivetran-jamie Jan 31, 2023
55dec39
Update models/stg_shopify.yml
fivetran-jamie Jan 31, 2023
484c20c
Update models/stg_shopify.yml
fivetran-jamie Jan 31, 2023
3739d26
Update models/stg_shopify.yml
fivetran-jamie Jan 31, 2023
d0e8aa3
Update models/stg_shopify.yml
fivetran-jamie Jan 31, 2023
942a8a1
Update models/stg_shopify.yml
fivetran-jamie Jan 31, 2023
46a3c9b
Update models/stg_shopify.yml
fivetran-jamie Jan 31, 2023
2cadc2e
Update models/stg_shopify.yml
fivetran-jamie Jan 31, 2023
428b2b1
Update models/stg_shopify.yml
fivetran-jamie Jan 31, 2023
3892a20
Merge pull request #50 from fivetran/feature/revamp/documentation
fivetran-jamie Jan 31, 2023
8e631b2
kick off buildkite
fivetran-jamie Jan 31, 2023
b847ce9
buildkite needs new schema
fivetran-jamie Jan 31, 2023
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
2 changes: 1 addition & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ steps:
commands: |
bash .buildkite/scripts/run_models.sh redshift

- label: ":bricks: Run Tests - Databricks"
- label: ":databricks: Run Tests - Databricks"
key: "run_dbt_databricks"
plugins:
- docker#v3.13.0:
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/scripts/run_models.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ dbt deps
dbt seed --target "$db" --full-refresh
dbt run --target "$db" --full-refresh
dbt test --target "$db"
dbt run --vars '{shopify__using_order_adjustment: false, shopify__using_order_line_refund: false, shopify__using_refund: false}' --target "$db" --full-refresh
dbt run --vars '{shopify_timezone: "America/New_York", shopify_using_fulfillment_event: true}' --target "$db" --full-refresh
dbt test --target "$db"
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
contact_links:
- name: Provide feedback to our dbt package team
url: https://www.surveymonkey.com/r/DQ7K7WW
about: Fill out our survey form to provide valuable feedback to the Fivetran team developing and maintaining the dbt packages.
- name: Ask a question during our office hours
url: https://calendly.com/fivetran-solutions-team/fivetran-solutions-team-office-hours
about: Schedule time during the external office hours block with the Fivetran Analytics Engineering team for support
Expand Down
98 changes: 97 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,101 @@
# dbt_shopify_source v0.7.0
# dbt_shopify_source v0.8.0

Lots of new features ahead!! We've revamped the package to keep up-to-date with new additions to the Shopify connector and feedback from the community.

This release includes 🚨 **Breaking Changes** 🚨.

## Documentation
- Created the [DECISIONLOG](https://github.com/fivetran/dbt_shopify_source/blob/main/DECISIONLOG.md) to log discussions and opinionated stances we took in designing the package ([PR #45](https://github.com/fivetran/dbt_shopify_source/pull/45)).
- README updated for easier package use and navigation ([PR #38](https://github.com/fivetran/dbt_shopify_source/pull/38)).

## Under the Hood
- Ensured Postgres compatibility ([PR #38](https://github.com/fivetran/dbt_shopify_source/pull/38)).
- Got rid of the `shopify__using_order_adjustment`, `shopify__using_order_line_refund`, and `shopify__using_refund` variables. Instead, the package will automatically create empty versions of the related models until the source `refund`, `order_line_refund`, and `order_adjustment` tables exist in your schema. See DECISIONLOG for more details ([PR #45](https://github.com/fivetran/dbt_shopify_source/pull/45)).
- Adjusts the organization of the `get_<table>_columns()` macros ([PR #39](https://github.com/fivetran/dbt_shopify_source/pull/39), [PR #40](https://github.com/fivetran/dbt_shopify_source/pull/40)).

## Feature Updates
- Addition of the `shopify_timezone` variable, which converts ALL timestamps included in the package (including `_fivetran_synced`) to a single target timezone in IANA Database format, ie "America/Los_Angeles" ([PR #41](https://github.com/fivetran/dbt_shopify_source/pull/41)).
- `shopify_<default_source_table_name>_identifier` variables added if an individual source table has a different name than the package expects ([PR #38](https://github.com/fivetran/dbt_shopify_source/pull/38)).
- The declaration of passthrough variables within your root `dbt_project.yml` has changed (but is backwards compatible). To allow for more flexibility and better tracking of passthrough columns, you will now want to define passthrough columns in the following format ([PR #40](https://github.com/fivetran/dbt_shopify_source/pull/40)):
> This applies to all passthrough columns within the `dbt_shopify_source` package and not just the `customer_pass_through_columns` example. See the README for which models have passthrough columns.
```yml
vars:
customer_pass_through_columns:
- name: "my_field_to_include" # Required: Name of the field within the source.
alias: "field_alias" # Optional: If you wish to alias the field within the staging model.
transform_sql: "cast(field_alias as string)" # Optional: If you wish to define the datatype or apply a light transformation.
```
- The following fields have been added to (➕) or removed from (➖) their respective staging models ([PR #39](https://github.com/fivetran/dbt_shopify_source/pull/39), [PR #40](https://github.com/fivetran/dbt_shopify_source/pull/40)):
- `stg_shopify__order`:
- ➕ `total_discounts_set`
- ➕ `total_line_items_price_set`
- ➕ `total_price_usd`
- ➕ `total_price_set`
- ➕ `total_tax_set`
- ➕ `total_tip_received`
- ➕ `is_deleted`
- ➕ `app_id`
- ➕ `checkout_id`
- ➕ `client_details_user_agent`
- ➕ `customer_locale`
- ➕ `order_status_url`
- ➕ `presentment_currency`
- ➕ `is_confirmed`
- `stg_shopify__customer`:
- ➕ `note`
- ➕ `lifetime_duration`
- ➕ `currency`
- ➕ `marketing_consent_state` (coalescing of `email_marketing_consent_state` and deprecated `accepts_marketing` field)
- ➕ `marketing_opt_in_level` (coalescing of `email_marketing_consent_opt_in_level` and deprecated `marketing_opt_in_level` field)
- ➕ `marketing_consent_updated_at` (coalescing of `email_marketing_consent_consent_updated_at` and deprecated `accepts_marketing_updated_at` field)
- ➖ `accepts_marketing`/`has_accepted_marketing`
- ➖ `accepts_marketing_updated_at`
- ➖ `marketing_opt_in_level`
- `stg_shopify__order_line_refund`:
- ➕ `subtotal_set`
- ➕ `total_tax_set`
- `stg_shopify__order_line`:
- ➕ `pre_tax_price_set`
- ➕ `price_set`
- ➕ `tax_code`
- ➕ `total_discount_set`
- ➕ `variant_title`
- ➕ `variant_inventory_management`
- ➕ `properties`
- ( ) `is_requiring_shipping` is renamed to `is_shipping_required`
- `stg_shopify__product`:
- ➕ `status`
- `stg_shopify__product_variant`
- ➖ `old_inventory_quantity` -> coalesced with `inventory_quantity`
- ➕ `inventory_quantity` -> coalesced with `old_inventory_quantity`
- The following source tables have been added to the package with respective staging models ([PR #39](https://github.com/fivetran/dbt_shopify_source/pull/39)):
- `abandoned_checkout`
- `collection_product`
- `collection`
- `customer_tag`
- `discount_code` -> if the table does not exist in your schema, the package will create an empty staging model and reference that ([PR #47](https://github.com/fivetran/dbt_shopify_source/pull/47/files), see [DECISIONLOG](https://github.com/fivetran/dbt_shopify/blob/main/DECISIONLOG.md))
- `fulfillment`
- `inventory_item`
- `inventory_level`
- `location`
- `metafield` ([#PR 49](https://github.com/fivetran/dbt_shopify_source/pull/49) as well)
- `order_note_attribute`
- `order_shipping_line`
- `order_shipping_tax_line`
- `order_tag`
- `order_url_tag`
- `price_rule`
- `product_image`
- `product_tag`
- `shop`
- `tender_transaction`
- `abandoned_checkout_discount_code`
- `order_discount_code`
- `tax_line`
- `abandoned_checkout_shipping_line` ([(PR #47)](https://github.com/fivetran/dbt_shopify_source/pull/47) as well)
- `fulfillment_event` -> This is NOT included by default. To include fulfillment events (used in the `shopify__daily_shop` model), set the `shopify_using_fulfillment_event` variable to `true` ([PR #48](https://github.com/fivetran/dbt_shopify_source/pull/48))

# dbt_shopify_source v0.7.0
## 🚨 Breaking Changes 🚨:
[PR #36](https://github.com/fivetran/dbt_shopify_source/pull/36) includes the following breaking changes:
- Dispatch update for dbt-utils to dbt-core cross-db macros migration. Specifically `{{ dbt_utils.<macro> }}` have been updated to `{{ dbt.<macro> }}` for the below macros:
Expand Down
24 changes: 24 additions & 0 deletions DECISIONLOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Decision Log

In creating this package, which is meant for a wide range of use cases, we had to take opinionated stances on a few different questions we came across during development. We've consolidated significant choices we made here, and will continue to update as the package evolves.

## Creating Empty Tables for Refunds, Order Line Refunds, and Order Adjustments

Source tables related to `refunds`, `order_line_refunds`, and `order_adjustments` are created in the Shopify schema dyanmically. For example, if your shop has not incurred any refunds, you will not have a `refund` table yet until you do refund an order.

Thus, the source package will create empty (1 row of all `NULL` fields) staging models if these source tables do not exist in your Shopify schema yet, and the transform package will work seamlessly with these empty models. Once `refund`, `order_line_refund`, or `order_adjustment` exists in your schema, the source and transform packages will automatically reference the new populated table(s). ([example](https://github.com/fivetran/dbt_shopify_source/blob/main/models/tmp/stg_shopify__refund_tmp.sql)).

> In previous versions of the package, you had to manually enable or disable transforms of `refund`, `order_line_refund`, or `order_adjustment` through variables. Because this required you to monitor your Shopify account/schema and update the variable(s) accordingly, we decided to pursue a more automated solution.

## Keeping Deleted Entities

Instead of automatically filtering out records where `_fivetran_deleted` is `true`, the package keeps these soft-deleted records, as they may persist as foreign keys in other tables. The package merely renames the deleted-flag to `is_deleted`, which you can filter out if you choose.

## Accepted Value Test Severity

We test the following columns for accepted values because their values are hard-coded to be pivoted out into columns and/or used as `JOIN` conditions in downstream models.
- `stg_shopify__price_rule.target_type`: accepted values are `line_item`, `shipping_line`
- `stg_shopify__price_rule.value_type`: accepted values are `percentage`, `fixed_amount`
- `stg_shopify__fulfillment.status`: accepted values are `pending`, `open`, `success`, `cancelled`, `error`, `failure`

We have chosen to make the severity of these tests `warn`, as non-accepted values will be filtered out in the transformation models. They will not introduce erroneous data.
Loading