Skip to content

SharePoint Custom Fields (Single line of text) - Gets cast to Python Pendulam DateTime #653

Description

@nikhilmakan02

Hi Everyone, doing a simple call to a SharePoint Document library to return the custom metadata fields related to a file. What's interesting is I can set the column type to 'Single line of text' in SharePoint but if I put certain numbers into the column it returns as a datetime object.

If I put text in the field on SharePoint it returns correctly as text or even if I put enough numbers it returns as text as well.

In the example below the Doc_ID column in SharePoint contains the numbers 1212.
image
image

result = await (
        client.drives.by_drive_id(drive_id)
        .items.by_drive_item_id(drive_item_id)
        .list_item.get()
    )

print(result.fields.additional_data["Doc_x0020_ID"])
print(type(result.fields.additional_data["Doc_x0020_ID"]))

Output:

1212-01-01 00:00:00+00:00
<class 'pendulum.datetime.DateTime'>

This seems like unexpected behavior?

Metadata

Metadata

Assignees

Labels

area:serializationFocused on functional modules of the productbugSomething isn't workingpriority:p0Blocking issue. Loss of critical functions eg security/privacy violation. Bug SLA<=48hrs

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions