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

List items for choice column type returns DateTime instead int #937

Closed
mkkubins opened this issue Oct 21, 2024 · 2 comments
Closed

List items for choice column type returns DateTime instead int #937

mkkubins opened this issue Oct 21, 2024 · 2 comments
Assignees
Labels
status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience

Comments

@mkkubins
Copy link

Describe the bug

Hi,

I am trying to get items for my SPO list as:

expand = "fields"
filter_ = f"fields/Modified gt '{last_modified}'"
query_params = ItemsRequestBuilder.ItemsRequestBuilderGetQueryParameters(
                    expand=expand,
                    top=self.TOP_ITEMS,
                    filter=filter_,
            )
request_configuration = RequestConfiguration(query_parameters=query_params)
items = await client.sites.by_site_id(
                    self.site_id
                ).lists.by_list_id(
                    list_id
                ).items.get(request_configuration=request_configuration)

I have SPO choice column defined as:

image

Items returned are:

{'@odata.etag': '"0d9665c9-94e7-418b-bc92-3e5936c57d6d,30"',
 'Title': 'Test 2',
 'Choicecolumntest': DateTime(1000, 1, 1, 0, 0, 0, tzinfo=Timezone('UTC')),
}

It looks like there is a bug as it returns the DateTime instead int.

Expected behavior

When extracting the choice and multi-choice columns data types should be reflected correctly.

How to reproduce

Create list with choice column type and get items from list.

image

expand = "fields"
filter_ = f"fields/Modified gt '{last_modified}'"
query_params = ItemsRequestBuilder.ItemsRequestBuilderGetQueryParameters(
                    expand=expand,
                    top=self.TOP_ITEMS,
                    filter=filter_,
            )
request_configuration = RequestConfiguration(query_parameters=query_params)
items = await client.sites.by_site_id(
                    self.site_id
                ).lists.by_list_id(
                    list_id
                ).items.get(request_configuration=request_configuration)

SDK Version

1.4.0

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output

Click to expand log ```
</details>


### Configuration

20.04.6 LTS (Focal Fossa)

### Other information

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

Hello @mkkubins thanks for using the SDK and for raising this.

This is likely an issue with JSON serialization.

What is your version the json srialization library are you using, is it the latest.

This could be related to microsoft/kiota-serialization-json-python#358

Please confirm if you have this even with latest version of the serialization library?

@shemogumbe shemogumbe added the status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close label Oct 22, 2024
@mkkubins
Copy link
Author

After upgrading to the latest version issue is fixed. Thanks for help!

@microsoft-github-policy-service microsoft-github-policy-service bot removed the status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close label Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience
Projects
None yet
Development

No branches or pull requests

2 participants