-
Notifications
You must be signed in to change notification settings - Fork 158
fix: revise blob.compose query parameters if_generation_match
#454
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
Conversation
@cojenco I will merge / repair the tests broken by my PRs this week. |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
@googlebot I consent. |
@cojenco I put back the |
Got it, thanks @tseaver! |
This currently will introduce a breaking change. Revising PR for backwards compatibility. |
No region tags are edited in this PR.This comment is generated by snippet-bot.
|
Updated PR to handle backwards compatibility. Ready for review:) |
google/cloud/storage/blob.py
Outdated
Setting to 0 makes the operation succeed only if there are no live | ||
versions of the object. | ||
|
||
If a list of long is passed in, makes the operation conditional on whether the |
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 recommend phrasing this something like:
"Note: In a previous version, this argument worked identically to the if_source_generation_match argument. For backwards-compatibility reasons, if a list is passed in, this argument will behave like if_source_generation_match and also issue a DeprecationWarning."
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.
Done. I like this phrasing a lot, thanks!
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!
…leapis#454) * revise blob.compose logic to match API usage * update tests * update system test * address comments * 🦉 Updates from OwlBot * revise logic for backwards compatibility * add tests * revise docstring * fix test * revise to DeprecationWarning * address comments and revise docstrings Co-authored-by: Tres Seaver <[email protected]> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
…leapis#454) * revise blob.compose logic to match API usage * update tests * update system test * address comments * 🦉 Updates from OwlBot * revise logic for backwards compatibility * add tests * revise docstring * fix test * revise to DeprecationWarning * address comments and revise docstrings Co-authored-by: Tres Seaver <[email protected]> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
This changes
if_generation_match
,if_metageneration_match
,if_source_generation_match
forblob.compose()
to fit API behaviorif_generation_match
andif_metageneration_match
is passed in as a list of long. Add conditional handling for backwards compatibility.if_generation_match
to be correctly included within the API request query parameters if it is type long. This makes the operation conditional on whether the composed object's current generation matches the given value.if_source_generation_match
as an optional parameter that serves as sourceObjects preconditions. This is sent with the API request body. When provided, the composition only performs if the generation of the source object that would be used matches this value.Fixes #453🦕