Python SDK: How do I paginate properly? Limit / Offset is being ignored?
Following the docs I have attempted to use Limit and Offset when doing a search query. The following code returns 4 objects when I have a limit set to 1. What am I doing wrong?
Thanks
items = box_user_client.search().query(search_query, limit=1, offset=0)
result = []
for item in items:
result.append(item)
# I would expect count to equal "1" but it equals "4"
count = len(result)
-
Hi ,
This is mainly due to what limit means in the Python SDK. In short the limit parameter is not a limiter on how many results are returned, but it limits how many results are returned per API call.
This closed issue covers the issue in more detail and discusses pagination.
Please let me know if you have any other questions about this,
Jon
Please sign in to leave a comment.
Comments
1 comment