Repository navigation
fix(storage): forward client in Blob.update_storage_class - #19152
Open
abhishekacharya200 wants to merge 1 commit into
Open
abhishekacharya200 wants to merge 1 commit into
abhishekacharya200 wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the update_storage_class method in blob.py to pass the client parameter to the underlying rewrite calls. Additionally, it updates the unit tests to verify this behavior in both single-pass and multi-pass scenarios. I have no feedback to provide as the changes are correct and well-tested.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Blob.update_storage_classaccepts aclientargument and documents it ("The client to use. If not passed, falls back to the client stored on the blob's bucket"), but it never passed it on. Bothself.rewrite(...)calls in the method leftclientout, sorewritealways fell back to the bucket's client and the argument had no effect.This forwards
client=clientin both rewrite calls (the first one and the token loop).The existing unit tests asserted the exact
rewritecall and did not includeclient, so I updated those expectations and addedtest_update_storage_class_single_pass_w_clientandtest_update_storage_class_multi_pass_w_client. With the source change reverted, the update_storage_class tests fail onmain(25 failures); with it, all oftests/unit/test_blob.pypasses (404 passed).ruff format --checkreports nothing on the changed files.