microsoftgraph / microsoftgraph/msgraph-sdk-python
AddPostRequestBody does not contain the values parameter anymore
還沒有人認領這個 Issue。
- 主要語言
- Python
- 星號
- 630
- 分支
- 96
- 平均合併
- 15 小時 20 分鐘
- 30 天內合併 PR
- 3
描述
Describe the bug
According to the documentation pages:
- https://learn.microsoft.com/en-us/graph/api/table-post-rows?view=graph-rest-1.0&tabs=python
- https://learn.microsoft.com/en-us/graph/api/tablerowcollection-add?view=graph-rest-1.0&tabs=python
there should be an option in the initialization of WorkbookTableRow and AddPostRequestBody to specify the values attribute. However, the construction of these objects ends with the following exception:
TypeError: WorkbookTableRow.__init__() got an unexpected keyword argument 'values'
This behavior disallows updating Excel using MS Graphs.
Expected behavior
When creating WorkbookTableRow or AddPostRequestBody with the values parameter, the object should be created, and the POST to the underlying Excel table should be successful.
How to reproduce
Follow the instructions on your documentation pages:
- https://learn.microsoft.com/en-us/graph/api/table-post-rows?view=graph-rest-1.0&tabs=python
- https://learn.microsoft.com/en-us/graph/api/tablerowcollection-add?view=graph-rest-1.0&tabs=python
SDK Version
1.12.0
Latest version known to work for scenario above?
No response
Known Workarounds
Use CLI
Debug output
Click to expand log
```Traceback (most recent call last):
File "/Applications/PyCharm.app/Contents/plugins/python/helpers-pro/pydevd_asyncio/pydevd_nest_asyncio.py", line 138, in run
return loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Applications/PyCharm.app/Contents/plugins/python/helpers-pro/pydevd_asyncio/pydevd_nest_asyncio.py", line 243, in run_until_complete
return f.result()
^^^^^^^^^^
File "/opt/homebrew/Cellar/python@3.11/3.11.9/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/futures.py", line 203, in result
raise self._exception.with_traceback(self._exception_tb)
File "/opt/homebrew/Cellar/python@3.11/3.11.9/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/tasks.py", line 277, in __step
result = coro.send(None)
^^^^^^^^^^^^^^^
File "/Users/michalkyjovsky/Dev/Work/litfin/orpea/orpea-client-to-excel-worker/sharepoint.py", line 82, in add_record
post_body = WorkbookTableRow(values=sanitized_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: WorkbookTableRow.init() got an unexpected keyword argument 'values'
</details>
### Configuration
- Chip: Apple M1 Pro
- OS: macOS Sequoia 15.1
- Architecture: ARM64
- To my knowledge, the issue is not specific to the configuration.
### Other information
_No response_
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
首先使用連結的 Microsoft Graph 文件範例,透過 WorkbookTableRow(values=...) 和 AddPostRequestBody(values=...) 重現建構函式失敗。追蹤這些模型類別的定義位置,並檢查現有測試是否涵蓋 values 參數。兩個物件都接受 values,且文件中的 POST 要求成功,即表示完成。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- python
- 領域
- api
- Issue 類型
- 缺陷
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 38/100