Create TableRow API reference example raises TypeError "unexpected keyword argument 'values'"
Describe the bug
Initializing a WorkbookTableRow as described in the API reference results in a TypeError.
Expected behavior
Correct initialization of a WorkbookTableRow in order to append a row to a workbook table.
How to reproduce
# from https://learn.microsoft.com/en-us/graph/api/table-post-rows?view=graph-rest-1.0&tabs=python
from msgraph.generated.models.workbook_table_row import WorkbookTableRow
request_body = WorkbookTableRow(
values = [
[
1,
2,
3,
],
[
4,
5,
6,
],
],
)
SDK Version
1.10.0
Latest version known to work for scenario above?
No response
Known Workarounds
No response
Debug output
Traceback (most recent call last):
File "example.py", line 3, in <module>
request_body = WorkbookTableRow(
TypeError: WorkbookTableRow.__init__() got an unexpected keyword argument 'values'
Configuration
No response
Other information
No response
Hello @jesperschlegel thanks for using the SDK and for raising this.
Looking at what you're doing, and following this https://github.com/microsoftgraph/msgraph-sdk-python/blob/main/msgraph/generated/models/workbook_table_row.py
Looks like there is an issue in our snippets as the class does not have values atribute.
The ideal scenario for working with this Model would be:
from msgraph.generated.models.workbook_table_row import WorkbookTableRow
# Create an instance of WorkbookTableRow with numeric values
workbook_table_row_instance = WorkbookTableRow(
index=5, odata_type="#microsoft.graph.workbookTableRow")
print(workbook_table_row_instance)
Considering your use case, what are you trying to achieve, is it to add rows to a workbook table, and populate the rows with some numeric data?
That's exactly my use case. Can you provide some example code on how to achieve this?
Any updates here? I'm having the same issue!