added issue with path fixes
This commit is contained in:
parent
07bcf43259
commit
9ef838217c
1 changed files with 11 additions and 0 deletions
|
|
@ -75,5 +75,16 @@ async def data_item_to_text_file(
|
||||||
else:
|
else:
|
||||||
raise IngestionError(message="Local files are not accepted.")
|
raise IngestionError(message="Local files are not accepted.")
|
||||||
|
|
||||||
|
# data is a relative file path (e.g., "file.json", "data/file.txt")
|
||||||
|
else:
|
||||||
|
# This is a relative file path - check if it exists and can be loaded
|
||||||
|
if settings.accept_local_file_path:
|
||||||
|
loader = get_loader_engine()
|
||||||
|
return await loader.load_file(data_item_path, preferred_loaders), loader.get_loader(
|
||||||
|
data_item_path, preferred_loaders
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
raise IngestionError(message="Local files are not accepted.")
|
||||||
|
|
||||||
# data is not a supported type
|
# data is not a supported type
|
||||||
raise IngestionError(message=f"Data type not supported: {type(data_item_path)}")
|
raise IngestionError(message=f"Data type not supported: {type(data_item_path)}")
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue