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

Fix/pagination backoff #10

Merged
merged 2 commits into from
May 24, 2022
Merged
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.4.9",
version="1.4.10",
description="Singer.io tap for extracting Shopify data",
author="Stitch",
url="http://github.com/singer-io/tap-shopify",
Expand Down
6 changes: 5 additions & 1 deletion tap_shopify/streams/inventory_levels.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,17 @@ def api_call_for_inventory_levels(self, parent_object_id, bookmark):
limit = RESULTS_PER_PAGE,
location_ids=parent_object_id
)

@shopify_error_handling
def get_next_page(self, inventory_page):
return inventory_page.next_page()

def get_inventory_levels(self, parent_object, bookmark):
inventory_page = self.api_call_for_inventory_levels(parent_object, bookmark)
yield from inventory_page

while inventory_page.has_next_page():
inventory_page = inventory_page.next_page()
inventory_page = self.get_next_page(inventory_page)
yield from inventory_page

def get_objects(self):
Expand Down