Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e730bf5

Browse filesBrowse files
authored
fix!: Change contructors of MRD and AAOW AsyncGrpcClient.grpc_client to AsyncGrpcClient (#1727)
Change contructors of MRD and AAOW `AsyncGrpcClient.grpc_client` to `AsyncGrpcClient`. This will help us extend multiple methods in AsyncGrpcClient in future. More details in b/479030029
1 parent 8e21a7f commit e730bf5
Copy full SHA for e730bf5
Expand file treeCollapse file tree

17 files changed

+60
-96
lines changed
Open diff view settings
Collapse file

‎google/cloud/storage/_experimental/asyncio/async_appendable_object_writer.py‎

Copy file name to clipboardExpand all lines: google/cloud/storage/_experimental/asyncio/async_appendable_object_writer.py
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class AsyncAppendableObjectWriter:
114114

115115
def __init__(
116116
self,
117-
client: AsyncGrpcClient.grpc_client,
117+
client: AsyncGrpcClient,
118118
bucket_name: str,
119119
object_name: str,
120120
generation: Optional[int] = None,
@@ -155,7 +155,7 @@ def __init__(
155155
await writer.close()
156156
```
157157
158-
:type client: :class:`~google.cloud.storage._experimental.asyncio.async_grpc_client.AsyncGrpcClient.grpc_client`
158+
:type client: :class:`~google.cloud.storage._experimental.asyncio.async_grpc_client.AsyncGrpcClient`
159159
:param client: async grpc client to use for making API requests.
160160
161161
:type bucket_name: str
@@ -304,7 +304,7 @@ async def _do_open():
304304
self._is_stream_open = False
305305

306306
self.write_obj_stream = _AsyncWriteObjectStream(
307-
client=self.client,
307+
client=self.client.grpc_client,
308308
bucket_name=self.bucket_name,
309309
object_name=self.object_name,
310310
generation_number=self.generation,
Collapse file

‎google/cloud/storage/_experimental/asyncio/async_multi_range_downloader.py‎

Copy file name to clipboardExpand all lines: google/cloud/storage/_experimental/asyncio/async_multi_range_downloader.py
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class AsyncMultiRangeDownloader:
125125
@classmethod
126126
async def create_mrd(
127127
cls,
128-
client: AsyncGrpcClient.grpc_client,
128+
client: AsyncGrpcClient,
129129
bucket_name: str,
130130
object_name: str,
131131
generation_number: Optional[int] = None,
@@ -136,7 +136,7 @@ async def create_mrd(
136136
"""Initializes a MultiRangeDownloader and opens the underlying bidi-gRPC
137137
object for reading.
138138
139-
:type client: :class:`~google.cloud.storage._experimental.asyncio.async_grpc_client.AsyncGrpcClient.grpc_client`
139+
:type client: :class:`~google.cloud.storage._experimental.asyncio.async_grpc_client.AsyncGrpcClient`
140140
:param client: The asynchronous client to use for making API requests.
141141
142142
:type bucket_name: str
@@ -168,7 +168,7 @@ async def create_mrd(
168168

169169
def __init__(
170170
self,
171-
client: AsyncGrpcClient.grpc_client,
171+
client: AsyncGrpcClient,
172172
bucket_name: str,
173173
object_name: str,
174174
generation_number: Optional[int] = None,
@@ -177,7 +177,7 @@ def __init__(
177177
"""Constructor for AsyncMultiRangeDownloader, clients are not adviced to
178178
use it directly. Instead it's adviced to use the classmethod `create_mrd`.
179179
180-
:type client: :class:`~google.cloud.storage._experimental.asyncio.async_grpc_client.AsyncGrpcClient.grpc_client`
180+
:type client: :class:`~google.cloud.storage._experimental.asyncio.async_grpc_client.AsyncGrpcClient`
181181
:param client: The asynchronous client to use for making API requests.
182182
183183
:type bucket_name: str
@@ -273,7 +273,7 @@ async def _do_open():
273273
self._is_stream_open = False
274274

275275
self.read_obj_str = _AsyncReadObjectStream(
276-
client=self.client,
276+
client=self.client.grpc_client,
277277
bucket_name=self.bucket_name,
278278
object_name=self.object_name,
279279
generation_number=self.generation_number,
@@ -432,7 +432,7 @@ async def generator():
432432

433433
# Re-initialize stream
434434
self.read_obj_str = _AsyncReadObjectStream(
435-
client=self.client,
435+
client=self.client.grpc_client,
436436
bucket_name=self.bucket_name,
437437
object_name=self.object_name,
438438
generation_number=self.generation_number,
Collapse file

‎samples/snippets/zonal_buckets/storage_create_and_write_appendable_object.py‎

Copy file name to clipboardExpand all lines: samples/snippets/zonal_buckets/storage_create_and_write_appendable_object.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ async def storage_create_and_write_appendable_object(
3535
"""
3636

3737
if grpc_client is None:
38-
grpc_client = AsyncGrpcClient().grpc_client
38+
grpc_client = AsyncGrpcClient()
3939
writer = AsyncAppendableObjectWriter(
4040
client=grpc_client,
4141
bucket_name=bucket_name,
Collapse file

‎samples/snippets/zonal_buckets/storage_finalize_appendable_object_upload.py‎

Copy file name to clipboardExpand all lines: samples/snippets/zonal_buckets/storage_finalize_appendable_object_upload.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ async def storage_finalize_appendable_object_upload(
3333
"""
3434

3535
if grpc_client is None:
36-
grpc_client = AsyncGrpcClient().grpc_client
36+
grpc_client = AsyncGrpcClient()
3737
writer = AsyncAppendableObjectWriter(
3838
client=grpc_client,
3939
bucket_name=bucket_name,
Collapse file

‎samples/snippets/zonal_buckets/storage_open_multiple_objects_ranged_read.py‎

Copy file name to clipboardExpand all lines: samples/snippets/zonal_buckets/storage_open_multiple_objects_ranged_read.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ async def storage_open_multiple_objects_ranged_read(
3636
grpc_client: an existing grpc_client to use, this is only for testing.
3737
"""
3838
if grpc_client is None:
39-
grpc_client = AsyncGrpcClient().grpc_client
39+
grpc_client = AsyncGrpcClient()
4040

4141
async def _download_range(object_name):
4242
"""Helper coroutine to download a range from a single object."""
Collapse file

‎samples/snippets/zonal_buckets/storage_open_object_multiple_ranged_read.py‎

Copy file name to clipboardExpand all lines: samples/snippets/zonal_buckets/storage_open_object_multiple_ranged_read.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ async def storage_open_object_multiple_ranged_read(
3333
grpc_client: an existing grpc_client to use, this is only for testing.
3434
"""
3535
if grpc_client is None:
36-
grpc_client = AsyncGrpcClient().grpc_client
36+
grpc_client = AsyncGrpcClient()
3737

3838
mrd = AsyncMultiRangeDownloader(grpc_client, bucket_name, object_name)
3939

Collapse file

‎samples/snippets/zonal_buckets/storage_open_object_read_full_object.py‎

Copy file name to clipboardExpand all lines: samples/snippets/zonal_buckets/storage_open_object_read_full_object.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ async def storage_open_object_read_full_object(
3333
grpc_client: an existing grpc_client to use, this is only for testing.
3434
"""
3535
if grpc_client is None:
36-
grpc_client = AsyncGrpcClient().grpc_client
36+
grpc_client = AsyncGrpcClient()
3737

3838
# mrd = Multi-Range-Downloader
3939
mrd = AsyncMultiRangeDownloader(grpc_client, bucket_name, object_name)
Collapse file

‎samples/snippets/zonal_buckets/storage_open_object_single_ranged_read.py‎

Copy file name to clipboardExpand all lines: samples/snippets/zonal_buckets/storage_open_object_single_ranged_read.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ async def storage_open_object_single_ranged_read(
3333
grpc_client: an existing grpc_client to use, this is only for testing.
3434
"""
3535
if grpc_client is None:
36-
grpc_client = AsyncGrpcClient().grpc_client
36+
grpc_client = AsyncGrpcClient()
3737

3838
mrd = AsyncMultiRangeDownloader(grpc_client, bucket_name, object_name)
3939

Collapse file

‎samples/snippets/zonal_buckets/storage_pause_and_resume_appendable_upload.py‎

Copy file name to clipboardExpand all lines: samples/snippets/zonal_buckets/storage_pause_and_resume_appendable_upload.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ async def storage_pause_and_resume_appendable_upload(
3232
grpc_client: an existing grpc_client to use, this is only for testing.
3333
"""
3434
if grpc_client is None:
35-
grpc_client = AsyncGrpcClient().grpc_client
35+
grpc_client = AsyncGrpcClient()
3636

3737
writer1 = AsyncAppendableObjectWriter(
3838
client=grpc_client,
Collapse file

‎samples/snippets/zonal_buckets/storage_read_appendable_object_tail.py‎

Copy file name to clipboardExpand all lines: samples/snippets/zonal_buckets/storage_read_appendable_object_tail.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ async def read_appendable_object_tail(
9090
grpc_client: an existing grpc_client to use, this is only for testing.
9191
"""
9292
if grpc_client is None:
93-
grpc_client = AsyncGrpcClient().grpc_client
93+
grpc_client = AsyncGrpcClient()
9494
writer = AsyncAppendableObjectWriter(
9595
client=grpc_client,
9696
bucket_name=bucket_name,

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.