DriveItem copy.post() returns DriveItem instead of progress URL

Open Beginner friendly
#1,628 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
67/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
api, documentation

Research direction

Start with the linked generated request builder, msgraph/generated/drives/item/items/item/copy/copy_request_builder.py, and the linked Microsoft Graph documentation for copy and long-running actions. Find the Python SDK's documentation location and check how it presents workarounds for operations that return monitoring URLs. Done means adding a Python workaround for retrieving and using the copy progress URL; the issue does not specify the exact workaround.

Written by the indexing model from the issue text.

Description

status:waiting-for-triage type:bug
Describe the bug

I want to monitor a long-running drive copy job to take action upon completion. The MS Graph API docs state the copy post call returns the monitor URL (see https://learn.microsoft.com/en-us/graph/api/driveitem-copy and https://learn.microsoft.com/en-us/graph/long-running-actions-overview) but the SDK returns an Optional(DriveItem) instead which is always None.

See https://github.com/microsoftgraph/msgraph-sdk-python/blob/c83cc2f50970bb59403c2337cdfea93f3dcfa81b/msgraph/generated/drives/item/items/item/copy/copy_request_builder.py#L34

Expected behavior

Returns the progress URL instead of the DriveItem / None

How to reproduce
body = CopyPostRequestBody(
        parent_reference = ItemReference(
        path = "new/path",
    ),
)
result = await graph_client.drives.by_drive_id(drive_id).items.by_drive_item_id(item_id).copy.post(body)
pprint(result)
Other information

This is apparently due to a bug somewhere in the graph definitions, see the DotNet bug report for more details (https://github.com/microsoftgraph/msgraph-sdk-dotnet/issues/2240).

While we wait for this to be fixed (3 years at least and no progress yet!), could you please document here a workaround so googling at least returns something helpful in Python?

Dominant language
Python
Stars
634
Forks
100
Avg merge
23h 18m
Merged PRs (30d)
7

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

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.

More from microsoftgraph/msgraph-sdk-python

All issues in microsoftgraph/msgraph-sdk-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.