diff --git a/libs/community/langchain_community/document_loaders/base_o365.py b/libs/community/langchain_community/document_loaders/base_o365.py index 33a7c5a818a..412076651d1 100644 --- a/libs/community/langchain_community/document_loaders/base_o365.py +++ b/libs/community/langchain_community/document_loaders/base_o365.py @@ -131,7 +131,7 @@ class O365BaseLoader(BaseLoader, BaseModel): if not isinstance(blob.path, PurePath): raise NotImplementedError("Expected blob path to be a PurePath") if blob.path: - file_metadata_ = metadata_dict.get(str(blob.path), {}) + file_metadata_ = metadata_dict.get(str(blob.path.name), {}) blob.metadata.update(file_metadata_) yield blob if self.recursive: