Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Ignore file not exists error when delete files in KB #663

Merged
merged 2 commits into from
Jan 16, 2025

Conversation

konokenj
Copy link
Contributor

Closes #662

Description of changes:

Ignore The file does not exist in bucket error when deleting a file from S3 bucket for knowledge bases. This makes users to be able to update bot if the uploaded file has gone after bot created.

Rather than removing the check logic, I added a flag. If there is a reason why you raise this error intentionally, please let me know.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@statefb
Copy link
Contributor

statefb commented Jan 15, 2025

Note: users already had an S3 bucket containing over 1,000 files that we wanted to copy files from. Currently, to initialize a KB, they need to upload at least one dummy file through the UI (this is another UX point we may want to improve - allowing creation of empty KBs).

After copying files directly in S3, we wanted to clean up by removing that initial dummy file from the DB, but it was already deleted from S3. This is why ignoring the "file not exists" error would be helpful in this scenario.

backend/app/usecases/bot.py Show resolved Hide resolved
backend/app/usecases/bot.py Show resolved Hide resolved
@konokenj
Copy link
Contributor Author

Thank you for your feedback! I added some comments.

Copy link
Contributor

@statefb statefb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@statefb statefb merged commit 8afe1c9 into aws-samples:v2 Jan 16, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Ignore file not exists error when deleting files from KB
2 participants