Fix: CSVLoader CC not working
This commit is contained in:
parent
4c63e40032
commit
b874fca246
1 changed files with 8 additions and 1 deletions
|
|
@ -28,4 +28,11 @@ class CSVLoaderComponent(CustomComponent):
|
||||||
file_path: str,
|
file_path: str,
|
||||||
metadata: dict
|
metadata: dict
|
||||||
) -> List[Document]:
|
) -> List[Document]:
|
||||||
return CSVLoader(file_path=file_path, metadata=metadata).load()
|
documents = CSVLoader(file_path=file_path).load()
|
||||||
|
if(metadata):
|
||||||
|
for document in documents:
|
||||||
|
if not document.metadata:
|
||||||
|
document.metadata = metadata
|
||||||
|
else:
|
||||||
|
document.metadata.update(metadata)
|
||||||
|
return documents
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue