Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create TableRow API reference example raises TypeError "unexpected keyword argument 'values'" #926

Open
jesperschlegel opened this issue Oct 9, 2024 · 3 comments
Assignees
Labels

Comments

@jesperschlegel
Copy link

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

@jesperschlegel jesperschlegel added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Oct 9, 2024
@shemogumbe
Copy link
Collaborator

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?

@shemogumbe shemogumbe added status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned labels Oct 16, 2024
@jesperschlegel
Copy link
Author

That's exactly my use case. Can you provide some example code on how to achieve this?

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Attention 👋 and removed status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close labels Oct 16, 2024
@ignacio-kognitos
Copy link

ignacio-kognitos commented Nov 6, 2024

Any updates here? I'm having the same issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants