Checklist
Description
I'm using the new (v5.1.0) SDK and I want to iterate over my 108 roles.
Investigation
The pagination logic in the RawClient incorrectly increments the page index for the lambda function get_next:
|
page=page + len(_items or []), |
When I change it to
page=page + 1, it correctly works.
Other paginated queries, e.g. listing users, and in the AsyncClient, also suffer from this. I found more than 60 occurrences of the pattern page = page + len(items or []) in the code base.
Reproduction
client = ManagementClient(...)
resp = client.roles.list()
for i, role in enumerate(resp):
print(f"{i}: {role.name}")
Expected output
108 lines with the role names
Actual input
50 lines with the role names (50 is the default for the per_page parameter)
Additional context
No response
auth0-python version
5.1.0
Python version
3.12
Checklist
Description
I'm using the new (v5.1.0) SDK and I want to iterate over my 108 roles.
Investigation
The pagination logic in the RawClient incorrectly increments the page index for the lambda function
get_next:auth0-python/src/auth0/management/roles/raw_client.py
Line 95 in 2f4906d
When I change it to
page=page + 1, it correctly works.Other paginated queries, e.g. listing users, and in the AsyncClient, also suffer from this. I found more than 60 occurrences of the pattern
page = page + len(items or [])in the code base.Reproduction
Expected output
108 lines with the role names
Actual input
50 lines with the role names (50 is the default for the
per_pageparameter)Additional context
No response
auth0-python version
5.1.0
Python version
3.12