Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 7, 2024
1 parent caf7d06 commit 0a8ccc1
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions comps/dataprep/redis/langchain/prepare_doc_redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,9 +445,7 @@ async def delete_single_file(file_path: str = Body(..., embed=True)):
except Exception as e:
if logflag:
logger.info(f"[ delete ] {e}, File {file_path} does not exists.")
raise HTTPException(
status_code=404, detail=f"File not found in db {KEY_INDEX_NAME}. Please check file_path."
)
raise HTTPException(status_code=404, detail=f"File not found in db {KEY_INDEX_NAME}. Please check file_path.")
file_ids = key_ids.split("#")

# delete file keys id in db KEY_INDEX_NAME
Expand All @@ -466,9 +464,7 @@ async def delete_single_file(file_path: str = Body(..., embed=True)):
except Exception as e:
if logflag:
logger.info(f"[ delete ] {e}. File {file_path} does not exists.")
raise HTTPException(
status_code=404, detail=f"File not found in db {INDEX_NAME}. Please check file_path."
)
raise HTTPException(status_code=404, detail=f"File not found in db {INDEX_NAME}. Please check file_path.")

# delete file content
try:
Expand All @@ -481,9 +477,9 @@ async def delete_single_file(file_path: str = Body(..., embed=True)):
# local file does not exist (restarted docker container)
if not delete_path.exists():
if logflag:
logger.info(f"[ delete ] File {file_path} not saved loacally.")
logger.info(f"[ delete ] File {file_path} not saved locally.")
return {"status": True}

# delete local file
if delete_path.is_file():
# delete file on local disk
Expand Down

0 comments on commit 0a8ccc1

Please sign in to comment.