feat(storage): Add delete_source_objects optional parameter to compose API#17163
Conversation
This change adds an optional `delete_source_objects` parameter to the `Blob.compose` method. When set to `True`, the source objects will be deleted after a successful composition. Changes: - Updated `Blob.compose` signature and docstring. - Included `deleteSourceObjects` in the API request body. - Added unit test in `tests/unit/test_blob.py`. - Added system test in `tests/system/test_blob.py`. Co-authored-by: nidhiii-27 <224584462+nidhiii-27@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This change adds an optional `delete_source_objects` parameter to the `Blob.compose` method. When set to `True`, the source objects will be deleted after a successful composition. Changes: - Updated `Blob.compose` signature and docstring. - Included `deleteSourceObjects` in the API request body. - Added unit test in `tests/unit/test_blob.py`. - Added system test in `tests/system/test_blob.py`. Co-authored-by: nidhiii-27 <224584462+nidhiii-27@users.noreply.github.com>
There was a problem hiding this comment.
Code Review
This pull request introduces a delete_source_objects parameter to the compose method in google/cloud/storage/blob.py, allowing source blobs to be automatically deleted after a successful composition. Corresponding unit and system tests have been added to verify this functionality. Feedback suggests reordering the new parameter to follow library conventions (placing it before retry) and updating the docstring accordingly.
Add an optional
delete_source_objectsboolean parameter to theBlob.composemethod ingoogle-cloud-storage. When this parameter is set toTrue, it includes thedeleteSourceObjectsfield in the request body to the GCS JSON API, which triggers the deletion of source objects upon successful composition.Unit and system tests have been added and verified to pass.
PR created automatically by Jules for task 8742736712890332678 started by @nidhiii-27