Skip to content

ListItem metadata returned by the SDK is different from what is returned from the API #913

Closed

Description

@devistollon

Describe the bug

I am trying to retrieve the ListItem related to a specified DriveItem

I am using the following code:
list_item = await self.graph_client.drives.by_drive_id(self.drive_id).items.by_drive_item_id(drive_item_id=drive_item_id).list_item.get()

After parsing the response, I’ve noticed that some fields in the output have different values compared to those returned by the Graph API playground.

Below is the output with the fields that differ:

// Python SDK Output
{
  //... other fields
  "_Revision": "2024-09-30T02:00:00Z",
  "AuthorLookupId": "2024-09-30T06:00:00Z",
  "EditorLookupId": "2024-09-30T10:00:00Z",
  "ItemChildCount": "2024-09-30T00:00:00Z",
  "FolderChildCount": "2024-09-30T00:00:00Z",
  "_UIVersionString": "2024-09-30T19:00:00Z"
}
// Graph API Playground Output
{
    //... other fields
    "_Revision": "02",
    "AuthorLookupId": "6",
    "EditorLookupId": "10",
    "_UIVersionString": "19.0"
}

For example, the correct _Revision field value is "02", but the SDK returns it as a date. The same issue appears with other standard SHP fields, which are numbers but are somehow converted to dates by the SDK.

Why does this behavior occur?

Expected behavior

I expect that the SDK returns the same value present in the Graph API Playground.

How to reproduce

  • Authentication with ClientSecretCredential class from the azure.identity.aio module;
  • Invoke the function above by passing a drive_id and a drive_item_id;

SDK Version

1.8.0 (Downloaded last week)

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output

Click to expand log ```
</details>


### Configuration

- OS: Windows Server 2019
- Python version: 3.11.9
- Architecture: x64

### Other information

_No response_

Activity

  1. shemogumbe commented on Oct 2, 2024

    @shemogumbe
    Contributor

    Hello Devis (@devistollon) thanks for using the SDK and for raising this.

    On this, we have had a scenario where a number of numeric fields are converted to datetime objects, this has been fixed in the latest version of the json serialization library, check out microsoft/kiota-serialization-json-python#358 and upgrade the library to the latest version.

    Hope this helps?

  2. devistollon commented on Oct 5, 2024

    @devistollon
    Author

    Hi Shem Ogumbe (@shemogumbe),
    I've forced the upgrade of the msgraph-sdk library and now everything works fine.

    Thank you

  3. shemogumbe commented on Oct 9, 2024

    @shemogumbe
    Contributor

    Closing as resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

questionFurther information is requestedtype:bugA broken experience

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions