-
Notifications
You must be signed in to change notification settings - Fork 7
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
Missing Pagination for List of Directs #612
Comments
@samwelkanda @baywet -- tagging some regulars here, are you guys monitoring the issues list? Thanks! |
Hi @temporaer You can use the page iterator to page through the different pages automatically. Unfortunately, there's no documentation sample for Python yet, but using the other languages and reading the source you should be able to extrapolate. CC @jasonjoh Let us know if you have any additional comments or questions. |
@temporaer depending on the application and requirements, some scenarios might require a full enumeration of all the elements (e.g. auditing data sets), some might need to stop mid-way through (e.g. user clicking a UI and paging through), and others might only need the first page (e.g. recap of the last few elements). We cannot assume that every application out there is going to need all items of the collection, that'd put unnecessary burden on the service and the client applications for scenarios where it's not needed. Let us know if you have any additional comments or questions. |
@baywet , you could return an iterator instead of a list, as is common practice. Then, each application can decide whether to fetch the next page, without adding unnecessary burden on the service. |
We did discuss that in the early design of this new generation of SDKs and decided to keep things simple for now. Here is more context in case you're interested. |
@baywet , I see. That's a very different argument though. In this case, please make sure this limitation is clearly documented, and a (potentially more involved) way to list all directs is provided. Thank you! |
I'm not super sure about the linked context -- it fseems that there, the work was completed, but it doesn't seem to explain why it wasn't picked up in the newer version of the SDK. Is there generally no pagination support, or are there certain list operations that you left out intentionally? |
Ah sorry, I assumed the context had been shared from internal discussions. Let us know if you have any additional comments or questions. |
Describe the bug
I am fetching directs via
client.users.by_user_id(user_id).direct_reports.get()
. The list is incomplete for users with many directs. Browsing through the code a bit, it seems that this API ignores the nextLink property and only returns the first page.Expected behavior
The list of returned directs should be complete.
How to reproduce
user_id
with many directsclient.users.by_user_id(user_id).direct_reports.get()
SDK Version
1.11.0
Latest version known to work for scenario above?
none.
Known Workarounds
No response
Debug output
Click to expand log
```The text was updated successfully, but these errors were encountered: