Skip to content

Commit 2b37906

Browse files
yoshi-automationtseaver
authored andcommitted
Remove send/recv msg size limit (via synth). (#8969)
1 parent 881ddb9 commit 2b37906

6 files changed

Lines changed: 34 additions & 33 deletions

File tree

google-cloud-speech/google/cloud/speech_v1/gapic/speech_client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,8 @@ def recognize(
222222
If a dict is provided, it must be of the same form as the protobuf
223223
message :class:`~google.cloud.speech_v1.types.RecognitionAudio`
224224
retry (Optional[google.api_core.retry.Retry]): A retry object used
225-
to retry requests. If ``None`` is specified, requests will not
226-
be retried.
225+
to retry requests. If ``None`` is specified, requests will
226+
be retried using a default configuration.
227227
timeout (Optional[float]): The amount of time, in seconds, to wait
228228
for the request to complete. Note that if ``retry`` is
229229
specified, the timeout applies to each individual attempt.
@@ -305,8 +305,8 @@ def long_running_recognize(
305305
If a dict is provided, it must be of the same form as the protobuf
306306
message :class:`~google.cloud.speech_v1.types.RecognitionAudio`
307307
retry (Optional[google.api_core.retry.Retry]): A retry object used
308-
to retry requests. If ``None`` is specified, requests will not
309-
be retried.
308+
to retry requests. If ``None`` is specified, requests will
309+
be retried using a default configuration.
310310
timeout (Optional[float]): The amount of time, in seconds, to wait
311311
for the request to complete. Note that if ``retry`` is
312312
specified, the timeout applies to each individual attempt.
@@ -376,8 +376,8 @@ def streaming_recognize(
376376
requests (iterator[dict|google.cloud.speech_v1.proto.cloud_speech_pb2.StreamingRecognizeRequest]): The input objects. If a dict is provided, it must be of the
377377
same form as the protobuf message :class:`~google.cloud.speech_v1.types.StreamingRecognizeRequest`
378378
retry (Optional[google.api_core.retry.Retry]): A retry object used
379-
to retry requests. If ``None`` is specified, requests will not
380-
be retried.
379+
to retry requests. If ``None`` is specified, requests will
380+
be retried using a default configuration.
381381
timeout (Optional[float]): The amount of time, in seconds, to wait
382382
for the request to complete. Note that if ``retry`` is
383383
specified, the timeout applies to each individual attempt.

google-cloud-speech/google/cloud/speech_v1/gapic/transports/speech_grpc_transport.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,14 @@ def __init__(
5959

6060
# Create the channel.
6161
if channel is None:
62-
channel = self.create_channel(address=address, credentials=credentials)
62+
channel = self.create_channel(
63+
address=address,
64+
credentials=credentials,
65+
options={
66+
"grpc.max_send_message_length": -1,
67+
"grpc.max_receive_message_length": -1,
68+
}.items(),
69+
)
6370

6471
self._channel = channel
6572

@@ -94,11 +101,7 @@ def create_channel(
94101
grpc.Channel: A gRPC channel object.
95102
"""
96103
return google.api_core.grpc_helpers.create_channel(
97-
address,
98-
credentials=credentials,
99-
scopes=cls._OAUTH_SCOPES,
100-
options={"grpc.max_receive_message_length": 256 * 1024 * 1024}.items(),
101-
**kwargs
104+
address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs
102105
)
103106

104107
@property

google-cloud-speech/google/cloud/speech_v1p1beta1/gapic/speech_client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,8 @@ def recognize(
222222
If a dict is provided, it must be of the same form as the protobuf
223223
message :class:`~google.cloud.speech_v1p1beta1.types.RecognitionAudio`
224224
retry (Optional[google.api_core.retry.Retry]): A retry object used
225-
to retry requests. If ``None`` is specified, requests will not
226-
be retried.
225+
to retry requests. If ``None`` is specified, requests will
226+
be retried using a default configuration.
227227
timeout (Optional[float]): The amount of time, in seconds, to wait
228228
for the request to complete. Note that if ``retry`` is
229229
specified, the timeout applies to each individual attempt.
@@ -305,8 +305,8 @@ def long_running_recognize(
305305
If a dict is provided, it must be of the same form as the protobuf
306306
message :class:`~google.cloud.speech_v1p1beta1.types.RecognitionAudio`
307307
retry (Optional[google.api_core.retry.Retry]): A retry object used
308-
to retry requests. If ``None`` is specified, requests will not
309-
be retried.
308+
to retry requests. If ``None`` is specified, requests will
309+
be retried using a default configuration.
310310
timeout (Optional[float]): The amount of time, in seconds, to wait
311311
for the request to complete. Note that if ``retry`` is
312312
specified, the timeout applies to each individual attempt.
@@ -376,8 +376,8 @@ def streaming_recognize(
376376
requests (iterator[dict|google.cloud.speech_v1p1beta1.proto.cloud_speech_pb2.StreamingRecognizeRequest]): The input objects. If a dict is provided, it must be of the
377377
same form as the protobuf message :class:`~google.cloud.speech_v1p1beta1.types.StreamingRecognizeRequest`
378378
retry (Optional[google.api_core.retry.Retry]): A retry object used
379-
to retry requests. If ``None`` is specified, requests will not
380-
be retried.
379+
to retry requests. If ``None`` is specified, requests will
380+
be retried using a default configuration.
381381
timeout (Optional[float]): The amount of time, in seconds, to wait
382382
for the request to complete. Note that if ``retry`` is
383383
specified, the timeout applies to each individual attempt.

google-cloud-speech/google/cloud/speech_v1p1beta1/gapic/transports/speech_grpc_transport.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,14 @@ def __init__(
5959

6060
# Create the channel.
6161
if channel is None:
62-
channel = self.create_channel(address=address, credentials=credentials)
62+
channel = self.create_channel(
63+
address=address,
64+
credentials=credentials,
65+
options={
66+
"grpc.max_send_message_length": -1,
67+
"grpc.max_receive_message_length": -1,
68+
}.items(),
69+
)
6370

6471
self._channel = channel
6572

google-cloud-speech/synth.metadata

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
2-
"updateTime": "2019-07-26T12:35:19.816916Z",
2+
"updateTime": "2019-08-06T16:44:05.691252Z",
33
"sources": [
44
{
55
"generator": {
66
"name": "artman",
7-
"version": "0.31.0",
8-
"dockerImage": "googleapis/artman@sha256:9aed6bbde54e26d2fcde7aa86d9f64c0278f741e58808c46573e488cbf6098f0"
7+
"version": "0.32.1",
8+
"dockerImage": "googleapis/artman@sha256:a684d40ba9a4e15946f5f2ca6b4bd9fe301192f522e9de4fff622118775f309b"
99
}
1010
},
1111
{
1212
"git": {
1313
"name": "googleapis",
1414
"remote": "https://github.com/googleapis/googleapis.git",
15-
"sha": "0906a9e74f4db789aee7fc5016ab828d3dd24f03",
16-
"internalRef": "260061471"
15+
"sha": "e699b0cba64ffddfae39633417180f1f65875896",
16+
"internalRef": "261759677"
1717
}
1818
},
1919
{

google-cloud-speech/synth.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,6 @@
5151
r"from google.cloud.speech_\1.gapic import speech_client as speech_\1",
5252
)
5353

54-
# Set the maximum received message size to 256 MiB, the default of 4 MiB is
55-
# often insufficient in practice.
56-
s.replace(
57-
"google/cloud/speech_v1/gapic/transports/speech_grpc_transport.py",
58-
"^(\s+)scopes=cls\._OAUTH_SCOPES,",
59-
"\g<1>scopes=cls._OAUTH_SCOPES,\n"
60-
"\g<1>options={\"grpc.max_receive_message_length\": 256 * 1024 * 1024}.items(),"
61-
)
62-
6354
# ----------------------------------------------------------------------------
6455
# Add templated files
6556
# ----------------------------------------------------------------------------

0 commit comments

Comments
 (0)