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

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

Closed
devistollon opened this issue Oct 1, 2024 · 3 comments
Assignees
Labels
question Further information is requested type:bug A broken experience

Comments

@devistollon
Copy link

devistollon commented Oct 1, 2024

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_
@devistollon devistollon added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Oct 1, 2024
@shemogumbe
Copy link
Collaborator

Hello @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?

@shemogumbe shemogumbe added question Further information is requested and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned labels Oct 2, 2024
@devistollon
Copy link
Author

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

Thank you

@shemogumbe
Copy link
Collaborator

Closing as resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested type:bug A broken experience
Projects
None yet
Development

No branches or pull requests

2 participants