From 8dc4bec9477e25df5149e68124eb19c3ec2494d0 Mon Sep 17 00:00:00 2001 From: Martin Triska Date: Mon, 14 Oct 2024 18:48:31 +0200 Subject: [PATCH] [community] [Bugfix] base_o365 document loader metadata needs to be JSON serializable (#26322) In order for indexer to work, all metadata in the documents need to be JSON serializable. Timestamps are not. See here: https://github.com/langchain-ai/langchain/blob/master/libs/core/langchain_core/indexing/api.py#L83-L89 @eyurtsev could you please review? It's a tiny PR :-) --- .../langchain_community/document_loaders/base_o365.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/community/langchain_community/document_loaders/base_o365.py b/libs/community/langchain_community/document_loaders/base_o365.py index b0d44e772403a..44002842bf25d 100644 --- a/libs/community/langchain_community/document_loaders/base_o365.py +++ b/libs/community/langchain_community/document_loaders/base_o365.py @@ -118,8 +118,8 @@ def _load_from_folder(self, folder: Folder) -> Iterable[Blob]: metadata_dict[file.name] = { "source": file.web_url, "mime_type": file.mime_type, - "created": file.created, - "modified": file.modified, + "created": str(file.created), + "modified": str(file.modified), "created_by": str(file.created_by), "modified_by": str(file.modified_by), "description": file.description,