Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Commit 6b9712f

Browse files
committed
Address comments
1 parent 833b567 commit 6b9712f

4 files changed

Lines changed: 4 additions & 18 deletions

File tree

gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/grpc.py.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class {{ service.name }}GrpcTransport({{ service.name }}Transport):
108108
def create_channel(cls,
109109
host: str{% if service.host %} = '{{ service.host }}'{% endif %},
110110
credentials: credentials.Credentials = None,
111-
scopes: Sequence[str] = None,
111+
scopes: Optional[Sequence[str]] = None,
112112
**kwargs) -> grpc.Channel:
113113
"""Create and return a gRPC channel object.
114114
Args:
@@ -118,7 +118,7 @@ class {{ service.name }}GrpcTransport({{ service.name }}Transport):
118118
credentials identify this application to the service. If
119119
none are specified, the client will attempt to ascertain
120120
the credentials from the environment.
121-
scopes (Sequence[str]): A optional list of scopes needed for this
121+
scopes (Optional[Sequence[str]]): A optional list of scopes needed for this
122122
service. These are only used when credentials are not specified and
123123
are passed to :func:`google.auth.default`.
124124
kwargs (Optional[dict]): Keyword arguments, which are passed to the

gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/grpc_asyncio.py.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class {{ service.grpc_asyncio_transport_name }}({{ service.name }}Transport):
4343
def create_channel(cls,
4444
host: str{% if service.host %} = '{{ service.host }}'{% endif %},
4545
credentials: credentials.Credentials = None,
46-
scopes: Sequence[str] = None,
46+
scopes: Optional[Sequence[str]] = None,
4747
**kwargs) -> aio.Channel:
4848
"""Create and return a gRPC AsyncIO channel object.
4949
Args:
@@ -53,7 +53,7 @@ class {{ service.grpc_asyncio_transport_name }}({{ service.name }}Transport):
5353
credentials identify this application to the service. If
5454
none are specified, the client will attempt to ascertain
5555
the credentials from the environment.
56-
scopes (Sequence[str]): A optional list of scopes needed for this
56+
scopes (Optional[Sequence[str]]): A optional list of scopes needed for this
5757
service. These are only used when credentials are not specified and
5858
are passed to :func:`google.auth.default`.
5959
kwargs (Optional[dict]): Keyword arguments, which are passed to the

tests/system/test_grpc_streams.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -79,31 +79,25 @@ def test_stream_stream_passing_dict(echo):
7979

8080
@pytest.mark.asyncio
8181
async def test_async_unary_stream_reader(async_echo):
82-
logging.debug('test_async_unary_stream_reader %s %s',
8382
threading.current_thread(), asyncio.get_event_loop())
8483
content = 'The hail in Wales falls mainly on the snails.'
8584
call = await async_echo.expand({
8685
'content': content,
8786
}, metadata=metadata)
88-
logging.debug('test_async_unary_stream_reader 2')
8987

9088
# Consume the response and ensure it matches what we expect.
9189
# with pytest.raises(exceptions.NotFound) as exc:
9290
for ground_truth in content.split(' '):
93-
logging.debug('test_async_unary_stream_reader 3')
9491
response = await call.read()
9592
assert response.content == ground_truth
96-
logging.debug('test_async_unary_stream_reader 4')
9793
assert ground_truth == 'snails.'
9894

99-
logging.debug('test_async_unary_stream_reader 5')
10095
trailing_metadata = await call.trailing_metadata()
10196
assert trailing_metadata == metadata
10297

10398

10499
@pytest.mark.asyncio
105100
async def test_async_unary_stream_async_generator(async_echo):
106-
logging.debug('test_async_unary_stream_async_generator')
107101
content = 'The hail in Wales falls mainly on the snails.'
108102
call = await async_echo.expand({
109103
'content': content,
@@ -123,7 +117,6 @@ async def test_async_unary_stream_async_generator(async_echo):
123117

124118
@pytest.mark.asyncio
125119
async def test_async_stream_unary_iterable(async_echo):
126-
logging.debug('test_async_stream_unary_iterable')
127120
requests = []
128121
requests.append(showcase.EchoRequest(content="hello"))
129122
requests.append(showcase.EchoRequest(content="world!"))
@@ -135,7 +128,6 @@ async def test_async_stream_unary_iterable(async_echo):
135128

136129
@pytest.mark.asyncio
137130
async def test_async_stream_unary_async_generator(async_echo):
138-
logging.debug('test_async_stream_unary_async_generator')
139131

140132
async def async_generator():
141133
yield showcase.EchoRequest(content="hello")
@@ -148,7 +140,6 @@ async def async_generator():
148140

149141
@pytest.mark.asyncio
150142
async def test_async_stream_unary_writer(async_echo):
151-
logging.debug('test_async_stream_unary_writer')
152143
call = await async_echo.collect()
153144
await call.write(showcase.EchoRequest(content="hello"))
154145
await call.write(showcase.EchoRequest(content="world!"))
@@ -160,7 +151,6 @@ async def test_async_stream_unary_writer(async_echo):
160151

161152
@pytest.mark.asyncio
162153
async def test_async_stream_unary_passing_dict(async_echo):
163-
logging.debug('test_async_stream_unary_passing_dict')
164154
requests = [{'content': 'hello'}, {'content': 'world!'}]
165155
call = await async_echo.collect(iter(requests))
166156
response = await call
@@ -169,7 +159,6 @@ async def test_async_stream_unary_passing_dict(async_echo):
169159

170160
@pytest.mark.asyncio
171161
async def test_async_stream_stream_reader_writier(async_echo):
172-
logging.debug('test_async_stream_stream_reader_writier')
173162
call = await async_echo.chat(metadata=metadata)
174163
await call.write(showcase.EchoRequest(content="hello"))
175164
await call.write(showcase.EchoRequest(content="world!"))
@@ -187,7 +176,6 @@ async def test_async_stream_stream_reader_writier(async_echo):
187176

188177
@pytest.mark.asyncio
189178
async def test_async_stream_stream_async_generator(async_echo):
190-
logging.debug('test_async_stream_stream_async_generator')
191179

192180
async def async_generator():
193181
yield showcase.EchoRequest(content="hello")
@@ -206,7 +194,6 @@ async def async_generator():
206194

207195
@pytest.mark.asyncio
208196
async def test_async_stream_stream_passing_dict(async_echo):
209-
logging.debug('test_async_stream_stream_passing_dict')
210197
requests = [{'content': 'hello'}, {'content': 'world!'}]
211198
call = await async_echo.chat(iter(requests), metadata=metadata)
212199

tests/system/test_grpc_unary.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
import pytest
1616
import asyncio
17-
import logging
1817

1918
from google.api_core import exceptions
2019
from google.rpc import code_pb2

0 commit comments

Comments
 (0)