From 0d11809adf9b6a15a90c5a0d58d4682a6b93942e Mon Sep 17 00:00:00 2001 From: Alban King Date: Mon, 13 Nov 2023 23:02:11 +0200 Subject: [PATCH] change record keys from hyphen to underscore --- tap_inventio/client.py | 2 +- tap_inventio/schemas/Customer.schema.json | 42 +++++++++---------- .../schemas/DimensionSetEntry.schema.json | 6 +-- tap_inventio/schemas/GLEntry.schema.json | 32 +++++++------- tap_inventio/streams.py | 4 +- 5 files changed, 43 insertions(+), 43 deletions(-) diff --git a/tap_inventio/client.py b/tap_inventio/client.py index c92e111..e8971f6 100644 --- a/tap_inventio/client.py +++ b/tap_inventio/client.py @@ -269,4 +269,4 @@ def post_process( The updated record dictionary, or ``None`` to skip the record. """ row["company_name"] = self._current_company_name - return row + return {key.replace("-", "_"): val for key, val in row.items()} diff --git a/tap_inventio/schemas/Customer.schema.json b/tap_inventio/schemas/Customer.schema.json index dccf90b..479aca7 100644 --- a/tap_inventio/schemas/Customer.schema.json +++ b/tap_inventio/schemas/Customer.schema.json @@ -19,13 +19,13 @@ "string" ] }, - "address-2": { + "address_2": { "type": [ "null", "string" ] }, - "post-code": { + "post_code": { "type": [ "null", "string" @@ -37,7 +37,7 @@ "string" ] }, - "country-region-code": { + "country_region_code": { "type": [ "null", "string" @@ -49,43 +49,43 @@ "string" ] }, - "e-mail": { + "e_mail": { "type": [ "null", "string" ] }, - "phone-no": { + "phone_no": { "type": [ "null", "string" ] }, - "currency-code": { + "currency_code": { "type": [ "null", "string" ] }, - "business-posting-group": { + "business_posting_group": { "type": [ "null", "string" ] }, - "vat-business-posting-group": { + "vat_business_posting_group": { "type": [ "null", "string" ] }, - "posting-group": { + "posting_group": { "type": [ "null", "string" ] }, - "vat-registration-no": { + "vat_registration_no": { "type": [ "null", "string" @@ -97,49 +97,49 @@ "string" ] }, - "blocked-status": { + "blocked_status": { "type": [ "null", "string" ] }, - "payment-terms-code": { + "payment_terms_code": { "type": [ "null", "string" ] }, - "bill-to-customer-no": { + "bill_to_customer_no": { "type": [ "null", "string" ] }, - "customer-price-group": { + "customer_price_group": { "type": [ "null", "string" ] }, - "language-code": { + "language_code": { "type": [ "null", "string" ] }, - "payment-method-code": { + "payment_method_code": { "type": [ "null", "string" ] }, - "customer-disc-group": { + "customer_disc_group": { "type": [ "null", "string" ] }, - "salesperson-code": { + "salesperson_code": { "type": [ "null", "string" @@ -151,19 +151,19 @@ "string" ] }, - "reminder-terms-code": { + "reminder_terms_code": { "type": [ "null", "string" ] }, - "fin-charge-terms-code": { + "fin_charge_terms_code": { "type": [ "null", "string" ] }, - "oioubl-profile-code": { + "oioubl_profile_code": { "type": [ "null", "string" diff --git a/tap_inventio/schemas/DimensionSetEntry.schema.json b/tap_inventio/schemas/DimensionSetEntry.schema.json index 1a3d7ba..5c5af33 100644 --- a/tap_inventio/schemas/DimensionSetEntry.schema.json +++ b/tap_inventio/schemas/DimensionSetEntry.schema.json @@ -1,7 +1,7 @@ { "type": "object", "properties": { - "entry-no": { + "entry_no": { "type": [ "string", "null" @@ -13,7 +13,7 @@ "null" ] }, - "value-code": { + "value_code": { "type": [ "string", "null" @@ -29,6 +29,6 @@ "required": [ "code", "company_name", - "entry-no" + "entry_no" ] } diff --git a/tap_inventio/schemas/GLEntry.schema.json b/tap_inventio/schemas/GLEntry.schema.json index 3a94d03..053b4e8 100644 --- a/tap_inventio/schemas/GLEntry.schema.json +++ b/tap_inventio/schemas/GLEntry.schema.json @@ -5,19 +5,19 @@ "type": "string", "$comment": "Added by the tap during loading" }, - "entry-no": { + "entry_no": { "type": [ "null", "string" ] }, - "posting-date": { + "posting_date": { "type": [ "null", "string" ] }, - "account-no": { + "account_no": { "type": [ "null", "string" @@ -29,13 +29,13 @@ "string" ] }, - "source-code": { + "source_code": { "type": [ "null", "string" ] }, - "dimension-set-id": { + "dimension_set_id": { "type": [ "null", "string" @@ -47,61 +47,61 @@ "string" ] }, - "document-type": { + "document_type": { "type": [ "null", "string" ] }, - "document-no": { + "document_no": { "type": [ "null", "string" ] }, - "source-type": { + "source_type": { "type": [ "null", "string" ] }, - "source-no": { + "source_no": { "type": [ "null", "string" ] }, - "bus-posting-group": { + "bus_posting_group": { "type": [ "null", "string" ] }, - "prod-posting-group": { + "prod_posting_group": { "type": [ "null", "string" ] }, - "global-dim-code1": { + "global_dim_code1": { "type": [ "null", "string" ] }, - "global-dim-code2": { + "global_dim_code2": { "type": [ "null", "string" ] }, - "job-no": { + "job_no": { "type": [ "null", "string" ] }, - "ic-partner-code": { + "ic_partner_code": { "type": [ "null", "string" @@ -120,5 +120,5 @@ ] } }, - "required": ["company_name", "account-no"] + "required": ["company_name", "account_no"] } diff --git a/tap_inventio/streams.py b/tap_inventio/streams.py index c1b2aa2..5006c51 100644 --- a/tap_inventio/streams.py +++ b/tap_inventio/streams.py @@ -79,7 +79,7 @@ class GLEntryStream(InventioStream): name = "GLEntry" records_jsonpath = "$.entries.entry[*]" - primary_keys = ("company_name", "entry-no") + primary_keys = ("company_name", "entry_no") class DimensionSetEntry(InventioStream): @@ -87,7 +87,7 @@ class DimensionSetEntry(InventioStream): name = "DimensionSetEntry" records_jsonpath = "$.dimension-entries.dimension-entry[*]" - primary_keys = ("company_name", "entry-no", "code") + primary_keys = ("company_name", "entry_no", "code") class Customer(InventioStream):