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

update shopify schemas #22

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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 setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setup(
name="tap-shopify",
version="1.6.0",
version="1.6.1",
description="Singer.io tap for extracting Shopify data",
author="Stitch",
url="http://github.com/singer-io/tap-shopify",
Expand Down
15 changes: 8 additions & 7 deletions tap_shopify/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ def sync():
shop_attributes = initialize_shopify_client()
sdc_fields = {"_sdc_shop_" + x: shop_attributes[x] for x in SDC_KEYS}

# If there is a currently syncing stream bookmark, shuffle the
# stream order so it gets sync'd first
currently_sync_stream_name = Context.state.get('bookmarks', {}).get('currently_sync_stream')
if currently_sync_stream_name:
shuffle_streams(currently_sync_stream_name)

# Emit all schemas first so we have them for child streams
for stream in Context.catalog["streams"]:
if Context.is_selected(stream["tap_stream_id"]):
Expand All @@ -146,12 +152,6 @@ def sync():
bookmark_properties=stream["replication_key"])
Context.counts[stream["tap_stream_id"]] = 0

# If there is a currently syncing stream bookmark, shuffle the
# stream order so it gets sync'd first
currently_sync_stream_name = Context.state.get('bookmarks', {}).get('currently_sync_stream')
if currently_sync_stream_name:
shuffle_streams(currently_sync_stream_name)

# Loop over streams in catalog
for catalog_entry in Context.catalog['streams']:
stream_id = catalog_entry['tap_stream_id']
Expand All @@ -167,7 +167,8 @@ def sync():
Context.state['bookmarks'] = {}
Context.state['bookmarks']['currently_sync_stream'] = stream_id

with Transformer() as transformer:
# some fields have epoch-time as date, hence transform into UTC date
with Transformer(singer.UNIX_SECONDS_INTEGER_DATETIME_PARSING) as transformer:
for rec in stream.sync():
extraction_time = singer.utils.now()
record_schema = catalog_entry['schema']
Expand Down
19 changes: 19 additions & 0 deletions tap_shopify/schemas/abandoned_checkouts.json
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,25 @@
"null",
"boolean"
]
},
"buyer_accepts_sms_marketing": {
"type": [
"null",
"boolean"
]
},
"sms_marketing_phone": {
"type": [
"null",
"string"
]
},
"total_duties": {
"type": [
"null",
"string"
],
"format": "singer.decimal"
}
}
}
Loading