microsoftgraph / msgraph-sample-github-connector-python

This Python application shows how to create a Microsoft Graph connector for GitHub repos and issues.
MIT License
10 stars 12 forks source link

UserItemRequestBuilderGetRequestConfiguration #2

Closed TTEarth closed 5 months ago

TTEarth commented 6 months ago

I encountered the following error during practice.

File "c:\dev\msgraph\graph.py", line 39, in get_user request_config = UserItemRequestBuilder.UserItemRequestBuilderGetRequestConfiguration( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^ AttributeError: type object 'UserItemRequestBuilder' has no attribute 'UserItemRequestBuilderGetRequestConfiguration'

I confirmed that the 'UserItemRequestBuilderGetRequestConfiguration' method is also used in the MS official documentation. How can I fix the error? Thank you~

jasonjoh commented 6 months ago

Looks like a bug in v1.3.0. Rolling back to v1.2.0 should unblock you until they address this: https://github.com/microsoftgraph/msgraph-sdk-python/issues/673

shemogumbe commented 6 months ago

Thanks for your continued use of the SDK and for raising this. As we work to resolve this, Do you mind considering:

  1. Downgrading to V1.2.0
  2. Make these adjustments in the meantime.
    +from kiota_abstractions.base_request_configuration import RequestConfiguration
    from msgraph import GraphServiceClient
    from msgraph.generated.groups.groups_request_builder import GroupsRequestBuilder
    graph_client = GraphServiceClient(credentials, scopes)
    query_params = GroupsRequestBuilder.GroupsRequestBuilderGetQueryParameters(
        filter = "startswith(displayName, 'a')",
        count = True,
        top = 1,
        orderby = ["displayName"],
    )
    -request_configuration = GroupsRequestBuilder.GroupsRequestBuilderGetRequestConfiguration(
    +request_configuration = RequestConfiguration(
    query_parameters = query_params,
    )
    request_configuration.headers.add("ConsistencyLevel", "eventual")
    result = await graph_client.groups.get(request_configuration = request_configuration)
jasonjoh commented 5 months ago

This appears to be addressed in 1.4.0, closing.