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: add preconditions and retry configuration to blob.create_resumable_upload_session #484

Merged
merged 3 commits into from Jun 30, 2021

Conversation

cojenco
Copy link
Contributor

@cojenco cojenco commented Jun 29, 2021

This adds preconditions and retry configuration to the upload entry method blob.create_resumable_upload_session(), in the continuation of #447 and #480.

This exposes the method to preconditions and therefore can make the operation conditional. It can also be configured with Retry objects and ConditionalRetryPolicy objects.

@cojenco cojenco requested review from andrewsg, tritone and a team June 29, 2021 20:19
@cojenco cojenco requested a review from a team as a code owner June 29, 2021 20:19
@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/python-storage API. label Jun 29, 2021
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Jun 29, 2021
@cojenco cojenco changed the title feat: add preconditions and retry configuration to blob.create_resumable_upload_session()()` feat: add preconditions and retry configuration to blob.create_resumable_upload_session Jun 29, 2021
Copy link
Contributor

@tritone tritone left a comment

Choose a reason for hiding this comment

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

Generally looks good. Did you test against the emulator that things are working?

def test_create_resumable_upload_session_with_conditional_retry_failure(self):
self._create_resumable_upload_session_helper(
retry=DEFAULT_RETRY_IF_GENERATION_SPECIFIED
)
Copy link
Contributor

Choose a reason for hiding this comment

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

How does this test verify that retries don't happen?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tritone, I've tested the retry behaviors against the emulator that things are working as intended. The unit test asserts if the mock call was made with the corresponding url and query params.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good!

google/cloud/storage/blob.py Show resolved Hide resolved
@cojenco cojenco mentioned this pull request Jun 30, 2021
4 tasks
@cojenco cojenco merged commit 0ae35ee into master Jun 30, 2021
@cojenco cojenco deleted the add-resumable-session branch June 30, 2021 16:56
cojenco added a commit to cojenco/python-storage that referenced this pull request Oct 13, 2021
…ble_upload_session (googleapis#484)

* feat: add preconditions and retry configuration to blob.create_resumable_upload_session

* move imports
cojenco added a commit to cojenco/python-storage that referenced this pull request Oct 13, 2021
…ble_upload_session (googleapis#484)

* feat: add preconditions and retry configuration to blob.create_resumable_upload_session

* move imports
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. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants