Skip to content

feat(storage): Add delete_source_objects optional parameter to compose API#17163

Merged
nidhiii-27 merged 2 commits into
mainfrom
add-delete-source-objects-to-compose-api-8742736712890332678
May 18, 2026
Merged

feat(storage): Add delete_source_objects optional parameter to compose API#17163
nidhiii-27 merged 2 commits into
mainfrom
add-delete-source-objects-to-compose-api-8742736712890332678

Conversation

@nidhiii-27
Copy link
Copy Markdown
Contributor

Add an optional delete_source_objects boolean parameter to the Blob.compose method in google-cloud-storage. When this parameter is set to True, it includes the deleteSourceObjects field 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

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>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

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>
@nidhiii-27 nidhiii-27 changed the title Add delete_source_objects optional parameter to compose API feat(storage): Add delete_source_objects optional parameter to compose API May 18, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

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.

Comment thread packages/google-cloud-storage/google/cloud/storage/blob.py
Comment thread packages/google-cloud-storage/google/cloud/storage/blob.py
@nidhiii-27 nidhiii-27 marked this pull request as ready for review May 18, 2026 05:53
@nidhiii-27 nidhiii-27 requested a review from a team as a code owner May 18, 2026 05:53
@nidhiii-27 nidhiii-27 merged commit 16ab4c2 into main May 18, 2026
31 checks passed
@nidhiii-27 nidhiii-27 deleted the add-delete-source-objects-to-compose-api-8742736712890332678 branch May 18, 2026 05:54
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.

2 participants