microsoftgraph / microsoftgraph/msgraph-sdk-python

OData system query options "format" not implemented

Open
#758 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area:documentation priority:p1 status:needs-discussion type:bug
Dominant language
Python
Stars
630
Forks
96
Avg merge
15h 20m
Merged PRs (30d)
3

Description

Describe the bug

In the documentation there is the Query "format" introduced that is supposed specify the media format that the requests returns.
Since the method is not implemented, the given example code for python throws an exception:

Traceback (most recent call last):
  File "/.../develop.py", line 37, in <module>
    query_params = UsersRequestBuilder.UsersRequestBuilderGetQueryParameters(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: UsersRequestBuilder.UsersRequestBuilderGetQueryParameters.__init__() got an unexpected keyword argument 'format'
Expected behavior

I would to be able to format the responses as needed. As a suboptimal solution the docs should not refer to nonexisting methods.

How to reproduce
from msgraph import GraphServiceClient
from msgraph.generated.users.users_request_builder import UsersRequestBuilder
from kiota_abstractions.base_request_configuration import RequestConfiguration

query_params = UsersRequestBuilder.UsersRequestBuilderGetQueryParameters(
    format = "json",
)

request_configuration = RequestConfiguration(
    query_parameters = query_params,
)
async def work():
    return await graph_client.users.get(request_configuration = request_configuration)

response = asyncio.run(work())
SDK Version

1.4.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at generated/users/users_request_builder.py and the UsersRequestBuilder.UsersRequestBuilderGetQueryParameters entry point used in the reproduction. Compare the SDK's supported query parameters with the linked Microsoft Graph documentation and determine whether format should be implemented or removed from the example. Done means the Python example no longer raises the unexpected-keyword exception and the documented behavior matches the SDK.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.