Title: A list item field with value 'PT' being converted to Datetime object · Issue #1340 · microsoftgraph/msgraph-sdk-python · GitHub
Open Graph Title: A list item field with value 'PT' being converted to Datetime object · Issue #1340 · microsoftgraph/msgraph-sdk-python
X Title: A list item field with value 'PT' being converted to Datetime object · Issue #1340 · microsoftgraph/msgraph-sdk-python
Description: Describe the bug I am trying to iterate through a SharePoint list entries/rows for further processing: ... list = await client.sites.by_site_id(site_id).lists.by_list_id(list_id).items.get(request_configuration=request_config) rows = [] ...
Open Graph Description: Describe the bug I am trying to iterate through a SharePoint list entries/rows for further processing: ... list = await client.sites.by_site_id(site_id).lists.by_list_id(list_id).items.get(request_...
X Description: Describe the bug I am trying to iterate through a SharePoint list entries/rows for further processing: ... list = await client.sites.by_site_id(site_id).lists.by_list_id(list_id).items.get(request_...
Opengraph URL: https://github.com/microsoftgraph/msgraph-sdk-python/issues/1340
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"A list item field with value 'PT' being converted to Datetime object","articleBody":"### Describe the bug\n\nI am trying to iterate through a SharePoint list entries/rows for further processing:\n...\nlist = await client.sites.by_site_id(site_id).lists.by_list_id(list_id).items.get(request_configuration=request_config)\n\nrows = []\nfor item_id in list.value:\n fields = item_id['fields']\n rows.append(fields.additional_data.get(\"code\")) # test\nrows\n\nbut when text/string field have value 'PT' it is retrieved as a datetime (exactly: \"datetime.timedelta(0)\"). It makes my code useless for keeping for example 'Country Code' as list's field. I have seen similar issue before with 4-digit strings, so maybe it is related.\n\nPlease, take a moment to look at this.\n\nhere some screenshots:\n\nlist in SP (just field 'code' and its values) :\n\n\u003cimg width=\"178\" height=\"303\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/13a8e144-e0ca-4ba1-986a-91d6e7543bb4\" /\u003e\n\nand my code results:\n\n\u003cimg width=\"267\" height=\"100\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/185229b7-7e7b-41f9-ad2c-3bf03778cd56\" /\u003e\n\n\n### Expected behavior\n\nExpected behavior would be to display 'code' the same way as it is in SharePoint list, means:\nPT\nPTA\n..\n\n\n### How to reproduce\n\nTo reproduce please just create new list with text field. Then add value 'PT' to this field and try to use await client.sites.by_site_id(site_id).lists.by_list_id(list_id).items.get(request_configuration=request_config) for entried reading.\n\n### SDK Version\n\n1.40.0\n\n### Latest version known to work for scenario above?\n\n_No response_\n\n### Known Workarounds\n\n_No response_\n\n### Debug output\n\n\u003cdetails\u003e\u003csummary\u003eClick to expand log\u003c/summary\u003e\n```\n\n\u003cLog output here\u003e\n\n```\n\u003c/details\u003e\n\n\n### Configuration\n\n_No response_\n\n### Other information\n\n_No response_","author":{"url":"https://github.com/SirTomRat","@type":"Person","name":"SirTomRat"},"datePublished":"2025-09-08T21:02:02.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/1340/msgraph-sdk-python/issues/1340"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:0eba305d-f70f-d5c3-ae66-712d58755613 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AC0C:18C2EF:357C92:46EDAE:69696B14 |
| html-safe-nonce | d9c4fa03961dd2d89f3c576a2c1b20306dac7d593925eea9b7e5d65b72792905 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQzBDOjE4QzJFRjozNTdDOTI6NDZFREFFOjY5Njk2QjE0IiwidmlzaXRvcl9pZCI6IjE2NzI2ODc1MDA2NjU2NDU4NDQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 32d4e45f30f1000a395ea4e490049c87eb7ed5f4528ef58bb5c4439fe4a53a48 |
| hovercard-subject-tag | issue:3395730362 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoftgraph/msgraph-sdk-python/1340/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1b57a701cc3b504ea1efe61705756a5a909471527087c284ed1637e0b20e019f/microsoftgraph/msgraph-sdk-python/issues/1340 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1b57a701cc3b504ea1efe61705756a5a909471527087c284ed1637e0b20e019f/microsoftgraph/msgraph-sdk-python/issues/1340 |
| og:image:alt | Describe the bug I am trying to iterate through a SharePoint list entries/rows for further processing: ... list = await client.sites.by_site_id(site_id).lists.by_list_id(list_id).items.get(request_... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | SirTomRat |
| hostname | github.com |
| expected-hostname | github.com |
| None | c6f193beb8ff08443adc07685d75302ab8aaf0a135f6e251c3ff3112c8deb881 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoftgraph/msgraph-sdk-python git https://github.com/microsoftgraph/msgraph-sdk-python.git |
| octolytics-dimension-user_id | 17304259 |
| octolytics-dimension-user_login | microsoftgraph |
| octolytics-dimension-repository_id | 534665999 |
| octolytics-dimension-repository_nwo | microsoftgraph/msgraph-sdk-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 534665999 |
| octolytics-dimension-repository_network_root_nwo | microsoftgraph/msgraph-sdk-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ec4d88fbe7ed62446d90b0a6d8e6db4248a8f8b8 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width