Content-Length: 651233 | pFad | https://www.github.com/googleapis/python-functions/commit/207db35e31d203120f66d384932e54fafec44a08

9F7 fix: remove client recv msg limit and add enums to `types/__init__.py… · googleapis/python-functions@207db35 · GitHub
Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.

Commit 207db35

Browse files
fix: remove client recv msg limit and add enums to types/__init__.py (#26)
PiperOrigin-RevId: 347055288 Source-Author: Google APIs <noreply@google.com> Source-Date: Fri Dec 11 12:44:37 2020 -0800 Source-Repo: googleapis/googleapis Source-Sha: dd372aa22ded7a8ba6f0e03a80e06358a3fa0907 Source-Link: googleapis/googleapis@dd372aa
1 parent bdb2f50 commit 207db35

File tree

6 files changed

+43
-15
lines changed

6 files changed

+43
-15
lines changed

google/cloud/functions_v1/services/cloud_functions_service/transports/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
_transport_registry["grpc"] = CloudFunctionsServiceGrpcTransport
3131
_transport_registry["grpc_asyncio"] = CloudFunctionsServiceGrpcAsyncIOTransport
3232

33-
3433
__all__ = (
3534
"CloudFunctionsServiceTransport",
3635
"CloudFunctionsServiceGrpcTransport",

google/cloud/functions_v1/services/cloud_functions_service/transports/grpc.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@ def __init__(
151151
ssl_credentials=ssl_credentials,
152152
scopes=scopes or self.AUTH_SCOPES,
153153
quota_project_id=quota_project_id,
154+
options=[
155+
("grpc.max_send_message_length", -1),
156+
("grpc.max_receive_message_length", -1),
157+
],
154158
)
155159
self._ssl_channel_credentials = ssl_credentials
156160
else:
@@ -169,9 +173,14 @@ def __init__(
169173
ssl_credentials=ssl_channel_credentials,
170174
scopes=scopes or self.AUTH_SCOPES,
171175
quota_project_id=quota_project_id,
176+
options=[
177+
("grpc.max_send_message_length", -1),
178+
("grpc.max_receive_message_length", -1),
179+
],
172180
)
173181

174182
self._stubs = {} # type: Dict[str, Callable]
183+
self._operations_client = None
175184

176185
# Run the base constructor.
177186
super().__init__(
@@ -195,7 +204,7 @@ def create_channel(
195204
) -> grpc.Channel:
196205
"""Create and return a gRPC channel object.
197206
Args:
198-
address (Optionsl[str]): The host for the channel to use.
207+
address (Optional[str]): The host for the channel to use.
199208
credentials (Optional[~.Credentials]): The
200209
authorization credentials to attach to requests. These
201210
credentials identify this application to the service. If
@@ -242,13 +251,11 @@ def operations_client(self) -> operations_v1.OperationsClient:
242251
client.
243252
"""
244253
# Sanity check: Only create a new client if we do not already have one.
245-
if "operations_client" not in self.__dict__:
246-
self.__dict__["operations_client"] = operations_v1.OperationsClient(
247-
self.grpc_channel
248-
)
254+
if self._operations_client is None:
255+
self._operations_client = operations_v1.OperationsClient(self.grpc_channel)
249256

250257
# Return the client from cache.
251-
return self.__dict__["operations_client"]
258+
return self._operations_client
252259

253260
@property
254261
def list_functions(

google/cloud/functions_v1/services/cloud_functions_service/transports/grpc_asyncio.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,10 @@ def __init__(
196196
ssl_credentials=ssl_credentials,
197197
scopes=scopes or self.AUTH_SCOPES,
198198
quota_project_id=quota_project_id,
199+
options=[
200+
("grpc.max_send_message_length", -1),
201+
("grpc.max_receive_message_length", -1),
202+
],
199203
)
200204
self._ssl_channel_credentials = ssl_credentials
201205
else:
@@ -214,6 +218,10 @@ def __init__(
214218
ssl_credentials=ssl_channel_credentials,
215219
scopes=scopes or self.AUTH_SCOPES,
216220
quota_project_id=quota_project_id,
221+
options=[
222+
("grpc.max_send_message_length", -1),
223+
("grpc.max_receive_message_length", -1),
224+
],
217225
)
218226

219227
# Run the base constructor.
@@ -227,6 +235,7 @@ def __init__(
227235
)
228236

229237
self._stubs = {}
238+
self._operations_client = None
230239

231240
@property
232241
def grpc_channel(self) -> aio.Channel:
@@ -246,13 +255,13 @@ def operations_client(self) -> operations_v1.OperationsAsyncClient:
246255
client.
247256
"""
248257
# Sanity check: Only create a new client if we do not already have one.
249-
if "operations_client" not in self.__dict__:
250-
self.__dict__["operations_client"] = operations_v1.OperationsAsyncClient(
258+
if self._operations_client is None:
259+
self._operations_client = operations_v1.OperationsAsyncClient(
251260
self.grpc_channel
252261
)
253262

254263
# Return the client from cache.
255-
return self.__dict__["operations_client"]
264+
return self._operations_client
256265

257266
@property
258267
def list_functions(

google/cloud/functions_v1/types/__init__.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,12 @@
3333
GenerateUploadUrlResponse,
3434
GenerateDownloadUrlRequest,
3535
GenerateDownloadUrlResponse,
36+
CloudFunctionStatus,
37+
)
38+
from .operations import (
39+
OperationMetadataV1,
40+
OperationType,
3641
)
37-
from .operations import OperationMetadataV1
38-
3942

4043
__all__ = (
4144
"CloudFunction",
@@ -55,5 +58,7 @@
5558
"GenerateUploadUrlResponse",
5659
"GenerateDownloadUrlRequest",
5760
"GenerateDownloadUrlResponse",
61+
"CloudFunctionStatus",
5862
"OperationMetadataV1",
63+
"OperationType",
5964
)

synth.metadata

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
"git": {
55
"name": ".",
66
"remote": "https://github.com/googleapis/python-functions.git",
7-
"sha": "6ef79767921676ef825fbac52fee5fdbec75d5e1"
7+
"sha": "bdb2f5093ed82a88ce769d72a1c6bc0643f3644c"
88
}
99
},
1010
{
1111
"git": {
1212
"name": "googleapis",
1313
"remote": "https://github.com/googleapis/googleapis.git",
14-
"sha": "3f87da2ed1ddc3566ef0810c4fc06a2682cc9f5f",
15-
"internalRef": "343022252"
14+
"sha": "dd372aa22ded7a8ba6f0e03a80e06358a3fa0907",
15+
"internalRef": "347055288"
1616
}
1717
},
1818
{

tests/unit/gapic/functions_v1/test_cloud_functions_service.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2886,6 +2886,10 @@ def test_cloud_functions_service_transport_channel_mtls_with_client_cert_source(
28862886
scopes=("https://www.googleapis.com/auth/cloud-platform",),
28872887
ssl_credentials=mock_ssl_cred,
28882888
quota_project_id=None,
2889+
options=[
2890+
("grpc.max_send_message_length", -1),
2891+
("grpc.max_receive_message_length", -1),
2892+
],
28892893
)
28902894
assert transport.grpc_channel == mock_grpc_channel
28912895
assert transport._ssl_channel_credentials == mock_ssl_cred
@@ -2927,6 +2931,10 @@ def test_cloud_functions_service_transport_channel_mtls_with_adc(transport_class
29272931
scopes=("https://www.googleapis.com/auth/cloud-platform",),
29282932
ssl_credentials=mock_ssl_cred,
29292933
quota_project_id=None,
2934+
options=[
2935+
("grpc.max_send_message_length", -1),
2936+
("grpc.max_receive_message_length", -1),
2937+
],
29302938
)
29312939
assert transport.grpc_channel == mock_grpc_channel
29322940

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://www.github.com/googleapis/python-functions/commit/207db35e31d203120f66d384932e54fafec44a08

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy