镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Missing Pagination for List of Directs #612

Description

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

  • create user user_id with many directs
  • fetch direct reports of this user with client.users.by_user_id(user_id).direct_reports.get()
  • confirm not all results are returned.

SDK Version

1.11.0

Latest version known to work for scenario above?

none.

Known Workarounds

No response

Debug output

Click to expand log ```
</details>


### Configuration

- OS: Ubuntu 22.04
- arch: x86


### Other information

_No response_

Activity

  1. temporaer commented on Nov 19, 2024

    @temporaer
    Author

    Samwel K. (@samwelkanda) Vincent Biret (@baywet) -- tagging some regulars here, are you guys monitoring the issues list? Thanks!

  2. baywet commented on Nov 19, 2024

    @baywet
    Member

    Hi Hannes Schulz (@temporaer)
    Thank you for using the SDK and for reaching out.

    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 Jason Johnston (@jasonjoh)

    Let us know if you have any additional comments or questions.

  3. added
    documentationImprovements or additions to documentation
    type:documentationGeneral documentation request or project documentation update
    area:documentationFocused on documentation of the product
    and removed
    type:bugA broken experience
    on Nov 19, 2024
  4. temporaer commented on Dec 25, 2024

    @temporaer
    Author

    Vincent Biret (@baywet) , Jason Johnston (@jasonjoh), why is this not a bug? Why isn't pagination implemented without user intervention like for other list operations?

  5. baywet commented on Dec 27, 2024

    @baywet
    Member

    Hannes Schulz (@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.

  6. temporaer commented on Dec 27, 2024

    @temporaer
    Author

    Vincent Biret (@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.

  7. baywet commented on Dec 27, 2024

    @baywet
    Member

    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.
    microsoft/kiota#1569

  8. temporaer commented on Dec 27, 2024

    @temporaer
    Author

    Vincent Biret (@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!

  9. temporaer commented on Dec 27, 2024

    @temporaer
    Author

    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?

  10. baywet commented on Dec 27, 2024

    @baywet
    Member

    Ah sorry, I assumed the context had been shared from internal discussions.
    The gist being: we needed a way to generate paging for the CLI, as layering CLI calls is more complex than in any other language.
    We were faced with a choice between building that in a bespoke way for the CLI only, or making it generic for any language that kiota supports.
    In the end, to prioritize the release of the CLI, it was decided to take the shortest path, and NOT make things generic for other languages to include an additional "getAll" method (in addition to get) which would include paging.

    Let us know if you have any additional comments or questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:documentationFocused on documentation of the productdocumentationImprovements or additions to documentationtype:documentationGeneral documentation request or project documentation update

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions