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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow exceptions to be included in batch responses #1043

Merged
merged 5 commits into from
May 31, 2023

Conversation

cojenco
Copy link
Contributor

@cojenco cojenco commented May 17, 2023

This adds a flag raise_exception to batch.finish(), which provides an option to include exceptions in batch responses in a non-backwards-incompatible way

  • when set to False, adds exceptions to the list of return responses
  • defaults to True, raises the final exception (current behavior)

The flag is also added to the Batch constructor and factory method client.batch()

Fixes #793 馃

@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: storage Issues related to the googleapis/python-storage API. labels May 17, 2023
@cojenco cojenco added the owlbot:run Add this label to trigger the Owlbot post processor. label May 17, 2023
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label May 17, 2023
@cojenco cojenco marked this pull request as ready for review May 17, 2023 22:21
@cojenco cojenco requested review from a team as code owners May 17, 2023 22:21
Copy link
Contributor

@andrewsg andrewsg left a comment

Choose a reason for hiding this comment

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

Looks promising, but might need tests - even if coverage is clear for some reason we should still try to test the functionality.

google/cloud/storage/batch.py Outdated Show resolved Hide resolved
@cojenco cojenco added the owlbot:run Add this label to trigger the Owlbot post processor. label May 19, 2023
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label May 19, 2023
@cojenco cojenco requested a review from andrewsg May 19, 2023 16:15
@cojenco cojenco added the owlbot:run Add this label to trigger the Owlbot post processor. label May 30, 2023
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label May 30, 2023
@cojenco cojenco added kokoro:force-run Add this label to force Kokoro to re-run the tests. and removed kokoro:force-run Add this label to force Kokoro to re-run the tests. labels May 30, 2023
@cojenco cojenco merged commit 94a35ba into googleapis:main May 31, 2023
13 checks passed
@cojenco cojenco deleted the batch-raise-exc branch November 16, 2023 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/python-storage API. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Batch context manager throws only the last exception occurred and no response is returned
2 participants