Skip to content

TypeError: start_span() got an unexpected keyword argument 'context' in microsoft-kiota-http #428

@JamesWordie

Description

@JamesWordie

Below is the error I am encountering in my project and deployment - which relates to mircosoft-kiota-http. The error is stating a TypeError on start_span() relating to "context"

The error is occurring while using the microsoft graph package to read from a mailbox using the delta builder.

Package version with the error - 1.6.6
Python version - 3.9
Deployed onto AKS

2024-12-17 09:20:46.640 | INFO     | __main__:process_batch:31 |  - Processing batch https://graph.microsoft.com/v1.0/users/d6ee16a1-9859-4e21-ae34-5fef0bde9bd7/mailFolders('inbox')/messages/delta?$deltatoken=LztZwWjo5IivWBhyxw5rAEQFNVslxZX9kw4uNFtmZHtqvMY7FWDfDG-vmY6BPbJXfBg1tSsM0la3GHFCwg50-6GHOEgDNLxnRSeO2s8s6g0.PsEHluygtAkPvdgPYo3Wyumwi4eMRfYBpSw6d6T8MGs.
Traceback (most recent call last):
  File "/app/mailbox_reader/script.py", line 121, in <module>
    asyncio.run(main())
  File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
    return future.result()
  File "/app/mailbox_reader/script.py", line 118, in main
    more, link = await process_batch(graph_client, blob_container_client, link)
  File "/app/mailbox_reader/script.py", line 37, in process_batch
    delta_response : DeltaGetResponse = await builder.with_url(delta_link).get()
  File "/venv/lib/python3.9/site-packages/msgraph/generated/users/item/mail_folders/item/messages/delta/delta_request_builder.py", line 51, in get
    return await self.request_adapter.send_async(request_info, DeltaGetResponse, error_mapping)
  File "/venv/lib/python3.9/site-packages/kiota_http/httpx_request_adapter.py", line 182, in send_async
    response = await self.get_http_response_message(request_info, parent_span)
  File "/venv/lib/python3.9/site-packages/kiota_http/httpx_request_adapter.py", line 522, in get_http_response_message
    _get_http_resp_span = self._start_local_tracing_span(
  File "/venv/lib/python3.9/site-packages/kiota_http/httpx_request_adapter.py", line 155, in _start_local_tracing_span
    span = tracer.start_span(name, context=_context)
TypeError: start_span() got an unexpected keyword argument 'context'

Full requirement's txt is attached below.

requirements.txt

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done ✔️

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions