[community][quick-fix]: changed from blob.path to blob.path.name in 0365BaseLoader. (#22287)

Description: file_metadata_ was not getting propagated to returned
documents. Changed the lookup key to the name of the blob's path.
Changed blob.path key to blob.path.name for metadata_dict key lookup.
Documentation: N/A
Unit tests: N/A

Co-authored-by: ccurme <chester.curme@gmail.com>
This commit is contained in:
Rahul Triptahi 2024-06-22 01:21:03 +05:30 committed by GitHub
parent f824f6d925
commit 4bb3d5c488
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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: