GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: Enable custom predicates for media operations by andrewsg · Pull Request #1385 · googleapis/python-storage

This repository was archived by the owner on Mar 31, 2026. It is now read-only.

Conversation

@andrewsg

@andrewsg andrewsg commented Nov 21, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

This refactor unifies the old resumable media retry code with the newer google.api_core retry code, enabling custom predicates for media operations.

Fixes #1361

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
andrewsg added 2 commits November 20, 2024 17:54
@andrewsg
intermediate commit
5a5a0f3
@andrewsg
progress
d1b8288
@andrewsg andrewsg added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Nov 21, 2024
@andrewsg
andrewsg requested review from a team November 21, 2024 18:09
@blunderbuss-gcf blunderbuss-gcf Bot assigned cojenco Nov 21, 2024
@product-auto-label product-auto-label Bot added size: xl Pull request size is extra large. api: storage Issues related to the googleapis/python-storage API. labels Nov 21, 2024
andrewsg added 2 commits November 21, 2024 13:16
@andrewsg
fix use of InvalidResponse
daf0fab
@andrewsg
fix tests, improve InvalidResponse handling, lint
b63856d
@andrewsg andrewsg removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Nov 21, 2024
cojenco
cojenco reviewed Nov 23, 2024
View reviewed changes

@cojenco cojenco left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Looking good, very excited about retry unification!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread tests/resumable_media/unit/requests/test__helpers.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google/cloud/storage/retry.py
requests.ConnectionError,
requests_exceptions.ChunkedEncodingError,
requests_exceptions.Timeout,
http.client.BadStatusLine,

@cojenco cojenco Nov 23, 2024

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM, thanks for consolidating the retryable errors. Looking at the requests docs requests.ConnectionError should be equivalent to requests.exceptions.ConnectionError so we're good!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread google/cloud/storage/_media/common.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google/cloud/storage/_media/requests/upload.py
)
return _request_helpers.wait_and_retry(retriable_request, self._retry_strategy)


@cojenco cojenco Nov 23, 2024

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

nit: to match download, we probably want to add the retry arg docstrings for MultipartUpload, ResumableUpload etc

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@andrewsg andrewsg Dec 2, 2024

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Thanks, done

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread google/cloud/storage/blob.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google/cloud/storage/blob.py
and the object will configure backoff and timeout options. Custom
predicates (customizable error codes) are not supported for media
operations such as this one.
and the object will configure backoff and timeout options.

@cojenco cojenco Nov 23, 2024

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

nit: Do we want to call out the default retry? I recall we received some feedback around stating the default value in our docstrings

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@andrewsg andrewsg Nov 25, 2024

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I would like to incorporate DEFAULT_RETRY into the docs somehow without copy/pasting it into every method. Not sure how to do that yet. I'd prefer not to include it in this change as it's already quite large but it's a good idea.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@cojenco cojenco Nov 28, 2024

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Sounds good, let's update that in a separate PR

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
cojenco
cojenco approved these changes Nov 28, 2024
View reviewed changes
@andrewsg
upload docstrings
a8512e2
@andrewsg
andrewsg merged commit a2e9b57 into 3.0-devel Dec 3, 2024
@andrewsg
andrewsg deleted the 3.0-retry-unification branch December 3, 2024 00:00
andrewsg added a commit that referenced this pull request Dec 5, 2024
@andrewsg
feat: Enable custom predicates for media operations (#1385)
7254470
andrewsg added a commit that referenced this pull request Dec 10, 2024
@andrewsg
feat: Enable custom predicates for media operations (#1385)
0497592
andrewsg added a commit that referenced this pull request Dec 11, 2024
@andrewsg
feat: Enable custom predicates for media operations (#1385)
f3517bf
@release-please release-please Bot mentioned this pull request Dec 11, 2024
chore(main): release 3.0.0 #1393
Merged
@andrewsg andrewsg mentioned this pull request Dec 12, 2024
feat!: Release 3.0.0 #1396
Merged
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

1 more reviewer
@cojenco cojenco cojenco approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@cojenco cojenco

Labels

api: storage Issues related to the googleapis/python-storage API. size: xl Pull request size is extra large.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@andrewsg @cojenco
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.