Skip to content

Commit

Permalink
Merge pull request #29 from fivetran/feature/fixed-orders-ordering
Browse files Browse the repository at this point in the history
changed ordering of the orders macro
  • Loading branch information
fivetran-joemarkiewicz authored Dec 1, 2021
2 parents 7ce244a + 35576cc commit e262987
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 35 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# dbt_shopify_source (next release)
# 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!
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

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

require-dbt-version: ">=0.20.0"
Expand Down
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: 'shopify_source_integration_tests'
version: '0.5.1'
version: '0.5.2'
profile: 'integration_tests'
config-version: 2

Expand Down
64 changes: 32 additions & 32 deletions macros/staging_columns.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,37 @@
{% macro get_order_columns() %}

{% set columns = [
{"name": "_fivetran_synced", "datatype": dbt_utils.type_timestamp()},
{"name": "id", "datatype": dbt_utils.type_numeric(), "alias": "order_id"},
{"name": "processed_at", "datatype": dbt_utils.type_timestamp(), "alias": "processed_timestamp"},
{"name": "updated_at", "datatype": dbt_utils.type_timestamp(), "alias": "updated_timestamp"},
{"name": "user_id", "datatype": dbt_utils.type_numeric()},
{"name": "total_discounts", "datatype": dbt_utils.type_float()},
{"name": "total_line_items_price", "datatype": dbt_utils.type_float()},
{"name": "total_price", "datatype": dbt_utils.type_float()},
{"name": "total_tax", "datatype": dbt_utils.type_float()},
{"name": "source_name", "datatype": dbt_utils.type_string()},
{"name": "subtotal_price", "datatype": dbt_utils.type_float()},
{"name": "taxes_included", "datatype": "boolean", "alias": "has_taxes_included"},
{"name": "total_weight", "datatype": dbt_utils.type_numeric()},
{"name": "landing_site_base_url", "datatype": dbt_utils.type_string()},
{"name": "location_id", "datatype": dbt_utils.type_numeric()},
{"name": "name", "datatype": dbt_utils.type_string()},
{"name": "note", "datatype": dbt_utils.type_string()},
{"name": "number", "datatype": dbt_utils.type_numeric()},
{"name": "order_number", "datatype": dbt_utils.type_numeric()},
{"name": "cancel_reason", "datatype": dbt_utils.type_string()},
{"name": "cancelled_at", "datatype": dbt_utils.type_timestamp(), "alias": "cancelled_timestamp"},
{"name": "cart_token", "datatype": dbt_utils.type_string()},
{"name": "checkout_token", "datatype": dbt_utils.type_string()},
{"name": "closed_at", "datatype": dbt_utils.type_timestamp(), "alias": "closed_timestamp"},
{"name": "created_at", "datatype": dbt_utils.type_timestamp(), "alias": "created_timestamp"},
{"name": "currency", "datatype": dbt_utils.type_string()},
{"name": "customer_id", "datatype": dbt_utils.type_numeric()},
{"name": "email", "datatype": dbt_utils.type_string()},
{"name": "financial_status", "datatype": dbt_utils.type_string()},
{"name": "fulfillment_status", "datatype": dbt_utils.type_string()},
{"name": "processing_method", "datatype": dbt_utils.type_string()},
{"name": "referring_site", "datatype": dbt_utils.type_string()},
{"name": "billing_address_address_1", "datatype": dbt_utils.type_string()},
{"name": "billing_address_address_2", "datatype": dbt_utils.type_string()},
{"name": "billing_address_city", "datatype": dbt_utils.type_string()},
Expand All @@ -19,27 +49,6 @@
{"name": "billing_address_zip", "datatype": dbt_utils.type_string()},
{"name": "browser_ip", "datatype": dbt_utils.type_string()},
{"name": "buyer_accepts_marketing", "datatype": "boolean", "alias": "has_buyer_accepted_marketing"},
{"name": "cancel_reason", "datatype": dbt_utils.type_string()},
{"name": "cancelled_at", "datatype": dbt_utils.type_timestamp(), "alias": "cancelled_timestamp"},
{"name": "cart_token", "datatype": dbt_utils.type_string()},
{"name": "checkout_token", "datatype": dbt_utils.type_string()},
{"name": "closed_at", "datatype": dbt_utils.type_timestamp(), "alias": "closed_timestamp"},
{"name": "created_at", "datatype": dbt_utils.type_timestamp(), "alias": "created_timestamp"},
{"name": "currency", "datatype": dbt_utils.type_string()},
{"name": "customer_id", "datatype": dbt_utils.type_numeric()},
{"name": "email", "datatype": dbt_utils.type_string()},
{"name": "financial_status", "datatype": dbt_utils.type_string()},
{"name": "fulfillment_status", "datatype": dbt_utils.type_string()},
{"name": "id", "datatype": dbt_utils.type_numeric(), "alias": "order_id"},
{"name": "landing_site_base_url", "datatype": dbt_utils.type_string()},
{"name": "location_id", "datatype": dbt_utils.type_numeric()},
{"name": "name", "datatype": dbt_utils.type_string()},
{"name": "note", "datatype": dbt_utils.type_string()},
{"name": "number", "datatype": dbt_utils.type_numeric()},
{"name": "order_number", "datatype": dbt_utils.type_numeric()},
{"name": "processed_at", "datatype": dbt_utils.type_timestamp(), "alias": "processed_timestamp"},
{"name": "processing_method", "datatype": dbt_utils.type_string()},
{"name": "referring_site", "datatype": dbt_utils.type_string()},
{"name": "total_shipping_price_set", "datatype": dbt_utils.type_string()},
{"name": "shipping_address_address_1", "datatype": dbt_utils.type_string()},
{"name": "shipping_address_address_2", "datatype": dbt_utils.type_string()},
Expand All @@ -56,18 +65,9 @@
{"name": "shipping_address_province", "datatype": dbt_utils.type_string()},
{"name": "shipping_address_province_code", "datatype": dbt_utils.type_string()},
{"name": "shipping_address_zip", "datatype": dbt_utils.type_string()},
{"name": "source_name", "datatype": dbt_utils.type_string()},
{"name": "subtotal_price", "datatype": dbt_utils.type_float()},
{"name": "taxes_included", "datatype": "boolean", "alias": "has_taxes_included"},
{"name": "test", "datatype": "boolean", "alias": "is_test_order"},
{"name": "token", "datatype": dbt_utils.type_string()},
{"name": "total_discounts", "datatype": dbt_utils.type_float()},
{"name": "total_line_items_price", "datatype": dbt_utils.type_float()},
{"name": "total_price", "datatype": dbt_utils.type_float()},
{"name": "total_tax", "datatype": dbt_utils.type_float()},
{"name": "total_weight", "datatype": dbt_utils.type_numeric()},
{"name": "updated_at", "datatype": dbt_utils.type_timestamp(), "alias": "updated_timestamp"},
{"name": "user_id", "datatype": dbt_utils.type_numeric()}
{"name": "_fivetran_synced", "datatype": dbt_utils.type_timestamp()}
] %}

{{ return(columns) }}
Expand Down

0 comments on commit e262987

Please sign in to comment.