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

未關閉 適合新手
#1,628 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
67/100
Issue 類型
文件
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
python
領域
api, documentation

研究方向

從連結的產生式要求建構器 msgraph/generated/drives/item/items/item/copy/copy_request_builder.py 以及關於複製和長時間執行動作的 Microsoft Graph 文件開始。找出 Python SDK 文件的位置,並檢查其中如何說明針對會傳回監控 URL 的作業的因應方法。完成條件是新增一種用於擷取及使用複製進度 URL 的 Python 因應方法;issue 未指定確切的因應方法。

由索引模型根據 Issue 內容生成。

描述

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?

主要語言
Python
星號
634
分支
100
平均合併
23 小時 18 分鐘
30 天內合併 PR
7

環境準備

在 Codespaces 中開啟

在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

microsoftgraph/msgraph-sdk-python 的其他 Issue

查看 microsoftgraph/msgraph-sdk-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。