Skip to content
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

No support for deltaToken and skipToken #242

Closed
Nemeczek opened this issue Jun 20, 2023 · 7 comments
Closed

No support for deltaToken and skipToken #242

Nemeczek opened this issue Jun 20, 2023 · 7 comments
Labels
question Further information is requested Status: No Recent Activity status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close

Comments

@Nemeczek
Copy link

Hey,

I have hard time understanding if this SDK is capable of making calls using Delta endpoints.
While I can use this endpoint to make initial request to the API:
await client.groups.delta.get()

I can't see how can I make subsequent calls to Delta endpoint. There is no option to attach deltaToken. The same goes for skipToken which is crucial because the initial delta call is almost always paged.

I can't even inject this query parameters by myself because the API expects only known query parameters:

   @dataclass
    class DeltaRequestBuilderGetQueryParameters():
        """
        Invoke function delta
        """
        def get_query_parameter(self,original_name: Optional[str] = None) -> str:
            """
            Maps the query parameters names to their encoded names for the URI template parsing.
            Args:
                originalName: The original query parameter name in the class.
            Returns: str
            """
            if original_name is None:
                raise Exception("original_name cannot be undefined")
            if original_name == "count":
                return "%24count"
            if original_name == "filter":
                return "%24filter"
            if original_name == "orderby":
                return "%24orderby"
            if original_name == "search":
                return "%24search"
            if original_name == "select":
                return "%24select"
            if original_name == "skip":
                return "%24skip"
            if original_name == "top":
                return "%24top"
            return original_name

To make matters even more confusing this kind of documentation is signaling something that is not yet supported by this SDK.

So is it possible to make calls, that include deltaToken or skipToken, using this SDK? Or will it be added in future. Because beyond that this SDK is looking amazing.

@peter-redkite
Copy link

Thanks for adding this issue. I had the same, was using the applications/service principals which utilize skipToken.
Also found the documentation unclear, which meant realizing that this wasn't supported at all to be confusing.

Agree that otherwise this is a good module. Not usable by me without this being solved.

@ghassett
Copy link

ghassett commented Jan 9, 2024

Hello, I am still seeing this same issue in msgraph-sdk==1.0.0 today.

I don't see how delta requests can be used (at all) until this is fixed.

The documentation states that we should add a skiptoken to the DeltaRequestBuilder.DeltaRequestBuilderGetQueryParameters that we instantiate, but this parameter is not permitted in the dataclass

Documentation for SDK Preview

graph_client = GraphServiceClient(credentials, scopes)

query_params = DeltaRequestBuilder.DeltaRequestBuilderGetQueryParameters(
		skiptoken = "oEBwdSP6uehIAxQOWq_3Ksh_TLol6KIm3stvdc6hGhZRi1hQ7Spe__dpvm3U4zReE4CYXC2zOtaKdi7KHlUtC2CbRiBIUwOxPKLa",
)
...

Error thrown:

TypeError: __init__() got an unexpected keyword argument 'skiptoken'

@HWFord16
Copy link

Adding to this issue as we ran into this yesterday trying to use deltatoken keyword within DeltaRequestBuilder.DeltaRequestBuilderGetQueryParameters() as shown in the example documentation here.

Screenshot 2024-03-12 at 5 45 34 PM

@Christiaan-Mathu
Copy link

Hi @baywet, this is quite similar problem that was resolved in #364 can we get an ETA on this and if there is workaround that we can use in the meanwhile 🙏

@baywet
Copy link
Member

baywet commented May 22, 2024

Hi everyone,
Apologies for the loooong delay in triage here. I'm not directly assigned to Python.
delta links (with delta tokens) and paging links (with skip tokens, returned through delta and collection endpoints) MUST be treated as opaque and MUST NOT be parsed but considered entirely.

This is why our generation process DOES NOT emit query parameters for deltaToken and skipToken, so consumers are not tempted to parse the link and store only the token, but instead use the entire URI.

To use those links, use the with url method instead, like so (excuse my python)

page1 = client.groups.delta.get()

page2 = client.groups.delta.with_url(page1.odata_next_link).get()

We have an issue to implement automatic pagination with the next links for you so you don't have to implement the iteration please upvote it if you feel like it'd be beneficial to you.

@baywet baywet added question Further information is requested needs author feedback status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close labels May 22, 2024
@Christiaan-Mathu
Copy link

Hi everyone, Apologies for the loooong delay in triage here. I'm not directly assigned to Python. delta links (with delta tokens) and paging links (with skip tokens, returned through delta and collection endpoints) MUST be treated as opaque and MUST NOT be parsed but considered entirely.

This is why our generation process DOES NOT emit query parameters for deltaToken and skipToken, so consumers are not tempted to parse the link and store only the token, but instead use the entire URI.

To use those links, use the with url method instead, like so (excuse my python)

page1 = client.groups.delta.get()

page2 = client.groups.delta.with_url(page1.odata_next_link).get()

We have an issue to implement automatic pagination with the next links for you so you don't have to implement the iteration please upvote it if you feel like it'd be beneficial to you.

Thank you @baywet 👏

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested Status: No Recent Activity status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close
Projects
None yet
Development

No branches or pull requests

6 participants