This repository was archived by the owner on Mar 31, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 173
feat: expose DELETE_OBJECT in AsyncGrpcClient
#1718
Merged
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
59b7b26
init code for exposing metadata ops into grpcCient
chandra-siri 9b66296
Merge branch 'main' into metadata_ops_in_grpc
chandra-siri 243fda9
Merge branch 'main' of github.com:googleapis/python-storage into meta…
chandra-siri 3a60452
Merge branch 'metadata_ops_in_grpc' of github.com:googleapis/python-s…
chandra-siri c0cdd26
add lint & formatting changes
chandra-siri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -19,7 +19,7 @@ | |||||||||||
| from google.cloud.storage._experimental.asyncio.async_multi_range_downloader import ( | ||||||||||||
| AsyncMultiRangeDownloader, | ||||||||||||
| ) | ||||||||||||
| from google.api_core.exceptions import FailedPrecondition | ||||||||||||
| from google.api_core.exceptions import FailedPrecondition, NotFound | ||||||||||||
|
|
||||||||||||
|
|
||||||||||||
| pytestmark = pytest.mark.skipif( | ||||||||||||
|
|
@@ -570,3 +570,33 @@ async def _run(): | |||||||||||
| blobs_to_delete.append(storage_client.bucket(_ZONAL_BUCKET).blob(object_name)) | ||||||||||||
|
|
||||||||||||
| event_loop.run_until_complete(_run()) | ||||||||||||
|
|
||||||||||||
| def test_delete_object_using_grpc_client( | ||||||||||||
| event_loop, grpc_client | ||||||||||||
| ): | ||||||||||||
| """ | ||||||||||||
| Test that a new writer when specifies `None` overrides the existing object. | ||||||||||||
|
Comment on lines
+576
to
+577
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The docstring for
Suggested change
|
||||||||||||
| """ | ||||||||||||
| object_name = f"test_append_with_generation-{uuid.uuid4()}" | ||||||||||||
|
|
||||||||||||
| async def _run(): | ||||||||||||
| writer = AsyncAppendableObjectWriter( | ||||||||||||
| grpc_client, _ZONAL_BUCKET, object_name, generation=0 | ||||||||||||
| ) | ||||||||||||
|
|
||||||||||||
| # Empty object is created. | ||||||||||||
| await writer.open() | ||||||||||||
| await writer.append(b'some_bytes') | ||||||||||||
| await writer.close() | ||||||||||||
|
|
||||||||||||
| await grpc_client.delete_object(bucket=f"projects/_/buckets/{_ZONAL_BUCKET}", object_=object_name) | ||||||||||||
|
chandra-siri marked this conversation as resolved.
Outdated
|
||||||||||||
|
|
||||||||||||
|
|
||||||||||||
| # trying to get raises raises 404. | ||||||||||||
| with pytest.raises(NotFound): | ||||||||||||
| await grpc_client.get_object(bucket=f"projects/_/buckets/{_ZONAL_BUCKET}", object_=object_name) | ||||||||||||
|
chandra-siri marked this conversation as resolved.
Outdated
|
||||||||||||
| # cleanup | ||||||||||||
| del writer | ||||||||||||
| gc.collect() | ||||||||||||
|
|
||||||||||||
| event_loop.run_until_complete(_run()) | ||||||||||||
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
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.
Uh oh!
There was an error while loading. Please reload this page.