From 4f255244e12873a3164e34bd0e63f548abb62006 Mon Sep 17 00:00:00 2001 From: Amy Dicks Date: Thu, 11 Apr 2024 17:10:17 +0100 Subject: [PATCH] json back to string --- macros/get_collection_columns.sql | 2 +- macros/get_fulfillment_columns.sql | 4 ++-- macros/get_order_adjustment_columns.sql | 4 ++-- macros/get_order_columns.sql | 10 +++++----- macros/get_order_line_columns.sql | 6 +++--- macros/get_order_shipping_line_columns.sql | 4 ++-- macros/get_order_shipping_tax_line_columns.sql | 2 +- macros/get_product_image_columns.sql | 2 +- macros/get_refund_columns.sql | 2 +- macros/get_transaction_columns.sql | 2 +- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/macros/get_collection_columns.sql b/macros/get_collection_columns.sql index f20f82a..56529f2 100644 --- a/macros/get_collection_columns.sql +++ b/macros/get_collection_columns.sql @@ -8,7 +8,7 @@ {"name": "id", "datatype": dbt.type_int()}, {"name": "published_at", "datatype": dbt.type_timestamp()}, {"name": "published_scope", "datatype": dbt.type_string()}, - {"name": "rules", "datatype": "json"}, + {"name": "rules", "datatype": dbt.type_string()}, {"name": "sort_order", "datatype": dbt.type_string()}, {"name": "title", "datatype": dbt.type_string()}, {"name": "updated_at", "datatype": dbt.type_timestamp()} diff --git a/macros/get_fulfillment_columns.sql b/macros/get_fulfillment_columns.sql index b121aa5..64d6add 100644 --- a/macros/get_fulfillment_columns.sql +++ b/macros/get_fulfillment_columns.sql @@ -12,8 +12,8 @@ {"name": "status", "datatype": dbt.type_string()}, {"name": "tracking_company", "datatype": dbt.type_string()}, {"name": "tracking_number", "datatype": dbt.type_string()}, - {"name": "tracking_numbers", "datatype": "json"}, - {"name": "tracking_urls", "datatype": "json"}, + {"name": "tracking_numbers", "datatype": dbt.type_string()}, + {"name": "tracking_urls", "datatype": dbt.type_string()}, {"name": "updated_at", "datatype": dbt.type_timestamp()} ] %} diff --git a/macros/get_order_adjustment_columns.sql b/macros/get_order_adjustment_columns.sql index f2255de..77b9028 100644 --- a/macros/get_order_adjustment_columns.sql +++ b/macros/get_order_adjustment_columns.sql @@ -5,9 +5,9 @@ {"name": "order_id", "datatype": dbt.type_numeric()}, {"name": "refund_id", "datatype": dbt.type_numeric()}, {"name": "amount", "datatype": dbt.type_float()}, - {"name": "amount_set", "datatype": "json"}, + {"name": "amount_set", "datatype": dbt.type_string()}, {"name": "tax_amount", "datatype": dbt.type_float()}, - {"name": "tax_amount_set", "datatype": "json"}, + {"name": "tax_amount_set", "datatype": dbt.type_string()}, {"name": "kind", "datatype": dbt.type_string()}, {"name": "reason", "datatype": dbt.type_string()}, {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()} diff --git a/macros/get_order_columns.sql b/macros/get_order_columns.sql index 9dc4e84..78d66c6 100644 --- a/macros/get_order_columns.sql +++ b/macros/get_order_columns.sql @@ -6,12 +6,12 @@ {"name": "updated_at", "datatype": dbt.type_timestamp()}, {"name": "user_id", "datatype": dbt.type_numeric()}, {"name": "total_discounts", "datatype": dbt.type_float()}, - {"name": "total_discounts_set", "datatype": "json"}, + {"name": "total_discounts_set", "datatype": dbt.type_string()}, {"name": "total_line_items_price", "datatype": dbt.type_float()}, - {"name": "total_line_items_price_set", "datatype": "json"}, + {"name": "total_line_items_price_set", "datatype": dbt.type_string()}, {"name": "total_price", "datatype": dbt.type_float()}, - {"name": "total_price_set", "datatype": "json"}, - {"name": "total_tax_set", "datatype": "json"}, + {"name": "total_price_set", "datatype": dbt.type_string()}, + {"name": "total_tax_set", "datatype": dbt.type_string()}, {"name": "total_tax", "datatype": dbt.type_float()}, {"name": "source_name", "datatype": dbt.type_string()}, {"name": "subtotal_price", "datatype": dbt.type_float()}, @@ -53,7 +53,7 @@ {"name": "billing_address_zip", "datatype": dbt.type_string()}, {"name": "browser_ip", "datatype": dbt.type_string()}, {"name": "buyer_accepts_marketing", "datatype": "boolean"}, - {"name": "total_shipping_price_set", "datatype": "json"}, + {"name": "total_shipping_price_set", "datatype": dbt.type_string()}, {"name": "shipping_address_address_1", "datatype": dbt.type_string()}, {"name": "shipping_address_address_2", "datatype": dbt.type_string()}, {"name": "shipping_address_city", "datatype": dbt.type_string()}, diff --git a/macros/get_order_line_columns.sql b/macros/get_order_line_columns.sql index 1116961..6067ce7 100644 --- a/macros/get_order_line_columns.sql +++ b/macros/get_order_line_columns.sql @@ -11,7 +11,7 @@ {"name": "name", "datatype": dbt.type_string()}, {"name": "order_id", "datatype": dbt.type_numeric()}, {"name": "pre_tax_price", "datatype": dbt.type_float()}, - {"name": "pre_tax_price_set", "datatype": "json"}, + {"name": "pre_tax_price_set", "datatype": dbt.type_string()}, {"name": "price", "datatype": dbt.type_float()}, {"name": "price_set", "datatype": "json"}, {"name": "product_id", "datatype": dbt.type_numeric()}, @@ -22,12 +22,12 @@ {"name": "tax_code", "datatype": dbt.type_string()}, {"name": "title", "datatype": dbt.type_string()}, {"name": "total_discount", "datatype": dbt.type_float()}, - {"name": "total_discount_set", "datatype": "json"}, + {"name": "total_discount_set", "datatype": dbt.type_string()}, {"name": "variant_id", "datatype": dbt.type_numeric()}, {"name": "variant_title", "datatype": dbt.type_string()}, {"name": "variant_inventory_management", "datatype": dbt.type_string()}, {"name": "vendor", "datatype": dbt.type_string()}, - {"name": "properties", "datatype": "json"} + {"name": "properties", "datatype": dbt.type_string()} ] %} {{ fivetran_utils.add_pass_through_columns(columns, var('order_line_pass_through_columns')) }} diff --git a/macros/get_order_shipping_line_columns.sql b/macros/get_order_shipping_line_columns.sql index 1c01c63..11452a0 100644 --- a/macros/get_order_shipping_line_columns.sql +++ b/macros/get_order_shipping_line_columns.sql @@ -6,12 +6,12 @@ {"name": "code", "datatype": dbt.type_string()}, {"name": "delivery_category", "datatype": dbt.type_string()}, {"name": "discounted_price", "datatype": dbt.type_float()}, - {"name": "discounted_price_set", "datatype": "json"}, + {"name": "discounted_price_set", "datatype": dbt.type_string()}, {"name": "id", "datatype": dbt.type_int()}, {"name": "order_id", "datatype": dbt.type_int()}, {"name": "phone", "datatype": dbt.type_string()}, {"name": "price", "datatype": dbt.type_float()}, - {"name": "price_set", "datatype": "json"}, + {"name": "price_set", "datatype": dbt.type_string()}, {"name": "requested_fulfillment_service_id", "datatype": dbt.type_string()}, {"name": "source", "datatype": dbt.type_string()}, {"name": "title", "datatype": dbt.type_string()} diff --git a/macros/get_order_shipping_tax_line_columns.sql b/macros/get_order_shipping_tax_line_columns.sql index 15bf4d8..e852365 100644 --- a/macros/get_order_shipping_tax_line_columns.sql +++ b/macros/get_order_shipping_tax_line_columns.sql @@ -5,7 +5,7 @@ {"name": "index", "datatype": dbt.type_int()}, {"name": "order_shipping_line_id", "datatype": dbt.type_int()}, {"name": "price", "datatype": dbt.type_float()}, - {"name": "price_set", "datatype": "json"}, + {"name": "price_set", "datatype": dbt.type_string()}, {"name": "rate", "datatype": dbt.type_float()}, {"name": "title", "datatype": dbt.type_string()} ] %} diff --git a/macros/get_product_image_columns.sql b/macros/get_product_image_columns.sql index 65f9803..7910741 100644 --- a/macros/get_product_image_columns.sql +++ b/macros/get_product_image_columns.sql @@ -10,7 +10,7 @@ {"name": "product_id", "datatype": dbt.type_int()}, {"name": "src", "datatype": dbt.type_string()}, {"name": "updated_at", "datatype": dbt.type_timestamp()}, - {"name": "variant_ids", "datatype": "json"}, + {"name": "variant_ids", "datatype": dbt.type_string()}, {"name": "width", "datatype": dbt.type_int()} ] %} diff --git a/macros/get_refund_columns.sql b/macros/get_refund_columns.sql index 9e3e909..affce51 100644 --- a/macros/get_refund_columns.sql +++ b/macros/get_refund_columns.sql @@ -8,7 +8,7 @@ {"name": "order_id", "datatype": dbt.type_numeric()}, {"name": "processed_at", "datatype": dbt.type_timestamp()}, {"name": "restock", "datatype": "boolean"}, - {"name": "total_duties_set", "datatype": "json"}, + {"name": "total_duties_set", "datatype": dbt.type_string()}, {"name": "user_id", "datatype": dbt.type_numeric()} ] %} diff --git a/macros/get_transaction_columns.sql b/macros/get_transaction_columns.sql index f8ea78f..2835938 100644 --- a/macros/get_transaction_columns.sql +++ b/macros/get_transaction_columns.sql @@ -20,7 +20,7 @@ {"name": "payment_credit_card_number", "datatype": dbt.type_string()}, {"name": "payment_credit_card_company", "datatype": dbt.type_string()}, {"name": "kind", "datatype": dbt.type_string()}, - {"name": "receipt", "datatype": "json"}, + {"name": "receipt", "datatype": dbt.type_string()}, {"name": "currency_exchange_id", "datatype": dbt.type_numeric()}, {"name": "currency_exchange_adjustment", "datatype": dbt.type_numeric()}, {"name": "currency_exchange_original_amount", "datatype": dbt.type_numeric()},