Skip to content

Commit

Permalink
change record keys from hyphen to underscore
Browse files Browse the repository at this point in the history
  • Loading branch information
Alban King committed Nov 13, 2023
1 parent 8a94a30 commit 0d11809
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 43 deletions.
2 changes: 1 addition & 1 deletion tap_inventio/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()}
42 changes: 21 additions & 21 deletions tap_inventio/schemas/Customer.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
"string"
]
},
"address-2": {
"address_2": {
"type": [
"null",
"string"
]
},
"post-code": {
"post_code": {
"type": [
"null",
"string"
Expand All @@ -37,7 +37,7 @@
"string"
]
},
"country-region-code": {
"country_region_code": {
"type": [
"null",
"string"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions tap_inventio/schemas/DimensionSetEntry.schema.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"type": "object",
"properties": {
"entry-no": {
"entry_no": {
"type": [
"string",
"null"
Expand All @@ -13,7 +13,7 @@
"null"
]
},
"value-code": {
"value_code": {
"type": [
"string",
"null"
Expand All @@ -29,6 +29,6 @@
"required": [
"code",
"company_name",
"entry-no"
"entry_no"
]
}
32 changes: 16 additions & 16 deletions tap_inventio/schemas/GLEntry.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -29,13 +29,13 @@
"string"
]
},
"source-code": {
"source_code": {
"type": [
"null",
"string"
]
},
"dimension-set-id": {
"dimension_set_id": {
"type": [
"null",
"string"
Expand All @@ -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"
Expand All @@ -120,5 +120,5 @@
]
}
},
"required": ["company_name", "account-no"]
"required": ["company_name", "account_no"]
}
4 changes: 2 additions & 2 deletions tap_inventio/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ class GLEntryStream(InventioStream):

name = "GLEntry"
records_jsonpath = "$.entries.entry[*]"
primary_keys = ("company_name", "entry-no")
primary_keys = ("company_name", "entry_no")


class DimensionSetEntry(InventioStream):
"""DimensionSetEntry-GET Stream."""

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):
Expand Down

0 comments on commit 0d11809

Please sign in to comment.