mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-19 11:08:55 +00:00
[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:
parent
f824f6d925
commit
4bb3d5c488
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user