Skip to content

Commit

Permalink
fix: Only /sellables endpoint supports paging with per_page (#85)
Browse files Browse the repository at this point in the history
* Revert "fix: Correct query parameter and increase value for page size (#83)"

This reverts commit 556978d.

* Only sellables endpoint supports paging with `per_page`
  • Loading branch information
ReubenFrankel authored Nov 27, 2024
1 parent 07343ac commit 76886c5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tap_veeqo/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class VeeqoStream(RESTStream):

url_base = "https://api.veeqo.com"
primary_keys: tuple[str, ...] = ("id",)
page_size = 1000
page_size = 100

@property
@override
Expand All @@ -33,7 +33,7 @@ def get_new_paginator(self):
@override
def get_url_params(self, context, next_page_token):
params = {
"per_page": self.page_size,
"page_size": self.page_size,
"page": next_page_token,
}

Expand Down
9 changes: 9 additions & 0 deletions tap_veeqo/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,15 @@ class SellablesStream(VeeqoStream):
path = "/sellables"
schema = SellableObject.to_dict()

@override
def get_url_params(self, context, next_page_token):
params = super().get_url_params(context, next_page_token)

del params["page_size"]
params["per_page"] = 1000

return params

@override
def get_child_context(self, record, context):
return {"variant_id": record["id"]}
Expand Down

0 comments on commit 76886c5

Please sign in to comment.