feat: extend adelete_document method to include remove_from_storage o… #225
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request extends the document deletion functionality to allow more granular control over where a document is deleted (from the key-value store and/or from file storage). It updates both the abstract and concrete implementations of the document deleter, modifies usage sites to use the new parameter, and ensures that tests reflect these changes.
API and Implementation Changes:
adelete_documentmethod in bothDocumentDeleter(abstract base class) andDefaultDocumentDeleternow accepts a newremove_from_storageboolean parameter, allowing callers to specify whether to remove the document from file storage in addition to the key-value store. [1] [2]adelete_documentare updated to document the newremove_from_storageparameter. [1] [2]DefaultDocumentDeleternow only deletes from file storage ifremove_from_storageisTrue, and the file deletion is wrapped in a try/except block to handle errors gracefully.Usage and Test Updates:
adelete_documentin_handle_source_uploadmethods in bothdefault_file_uploader.pyanddefault_source_uploader.pyare updated to explicitly setremove_from_storage=Falsewhen only a key-value store deletion is required. [1] [2]adelete_documentis called with the newremove_from_storageparameter. [1] [2]** issue:
#224