Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Commit

Permalink
fix: remove client recv msg limit fix: add enums to `types/__init__.p…
Browse files Browse the repository at this point in the history
…y` (#62)

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

Co-authored-by: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com>
  • Loading branch information
yoshi-automation and busunkim96 authored Dec 28, 2020
1 parent 2fafb45 commit 3476c0f
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
_transport_registry["grpc"] = LanguageServiceGrpcTransport
_transport_registry["grpc_asyncio"] = LanguageServiceGrpcAsyncIOTransport


__all__ = (
"LanguageServiceTransport",
"LanguageServiceGrpcTransport",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ def __init__(
ssl_credentials=ssl_credentials,
scopes=scopes or self.AUTH_SCOPES,
quota_project_id=quota_project_id,
options=[
("grpc.max_send_message_length", -1),
("grpc.max_receive_message_length", -1),
],
)
self._ssl_channel_credentials = ssl_credentials
else:
Expand All @@ -165,6 +169,10 @@ def __init__(
ssl_credentials=ssl_channel_credentials,
scopes=scopes or self.AUTH_SCOPES,
quota_project_id=quota_project_id,
options=[
("grpc.max_send_message_length", -1),
("grpc.max_receive_message_length", -1),
],
)

self._stubs = {} # type: Dict[str, Callable]
Expand All @@ -191,7 +199,7 @@ def create_channel(
) -> grpc.Channel:
"""Create and return a gRPC channel object.
Args:
address (Optionsl[str]): The host for the channel to use.
address (Optional[str]): The host for the channel to use.
credentials (Optional[~.Credentials]): The
authorization credentials to attach to requests. These
credentials identify this application to the service. If
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ def __init__(
ssl_credentials=ssl_credentials,
scopes=scopes or self.AUTH_SCOPES,
quota_project_id=quota_project_id,
options=[
("grpc.max_send_message_length", -1),
("grpc.max_receive_message_length", -1),
],
)
self._ssl_channel_credentials = ssl_credentials
else:
Expand All @@ -210,6 +214,10 @@ def __init__(
ssl_credentials=ssl_channel_credentials,
scopes=scopes or self.AUTH_SCOPES,
quota_project_id=quota_project_id,
options=[
("grpc.max_send_message_length", -1),
("grpc.max_receive_message_length", -1),
],
)

# Run the base constructor.
Expand Down
3 changes: 2 additions & 1 deletion google/cloud/language_v1/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
ClassifyTextResponse,
AnnotateTextRequest,
AnnotateTextResponse,
EncodingType,
)


__all__ = (
"Document",
"Sentence",
Expand All @@ -64,4 +64,5 @@
"ClassifyTextResponse",
"AnnotateTextRequest",
"AnnotateTextResponse",
"EncodingType",
)
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
_transport_registry["grpc"] = LanguageServiceGrpcTransport
_transport_registry["grpc_asyncio"] = LanguageServiceGrpcAsyncIOTransport


__all__ = (
"LanguageServiceTransport",
"LanguageServiceGrpcTransport",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ def __init__(
ssl_credentials=ssl_credentials,
scopes=scopes or self.AUTH_SCOPES,
quota_project_id=quota_project_id,
options=[
("grpc.max_send_message_length", -1),
("grpc.max_receive_message_length", -1),
],
)
self._ssl_channel_credentials = ssl_credentials
else:
Expand All @@ -165,6 +169,10 @@ def __init__(
ssl_credentials=ssl_channel_credentials,
scopes=scopes or self.AUTH_SCOPES,
quota_project_id=quota_project_id,
options=[
("grpc.max_send_message_length", -1),
("grpc.max_receive_message_length", -1),
],
)

self._stubs = {} # type: Dict[str, Callable]
Expand All @@ -191,7 +199,7 @@ def create_channel(
) -> grpc.Channel:
"""Create and return a gRPC channel object.
Args:
address (Optionsl[str]): The host for the channel to use.
address (Optional[str]): The host for the channel to use.
credentials (Optional[~.Credentials]): The
authorization credentials to attach to requests. These
credentials identify this application to the service. If
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ def __init__(
ssl_credentials=ssl_credentials,
scopes=scopes or self.AUTH_SCOPES,
quota_project_id=quota_project_id,
options=[
("grpc.max_send_message_length", -1),
("grpc.max_receive_message_length", -1),
],
)
self._ssl_channel_credentials = ssl_credentials
else:
Expand All @@ -210,6 +214,10 @@ def __init__(
ssl_credentials=ssl_channel_credentials,
scopes=scopes or self.AUTH_SCOPES,
quota_project_id=quota_project_id,
options=[
("grpc.max_send_message_length", -1),
("grpc.max_receive_message_length", -1),
],
)

# Run the base constructor.
Expand Down
3 changes: 2 additions & 1 deletion google/cloud/language_v1beta2/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
ClassifyTextResponse,
AnnotateTextRequest,
AnnotateTextResponse,
EncodingType,
)


__all__ = (
"Document",
"Sentence",
Expand All @@ -64,4 +64,5 @@
"ClassifyTextResponse",
"AnnotateTextRequest",
"AnnotateTextResponse",
"EncodingType",
)
6 changes: 3 additions & 3 deletions synth.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/python-language.git",
"sha": "8c9fdeb8dbf5376dc2ac813e4e9b14a8886ebd51"
"sha": "8dde55cdd0e956c333039c0b74e49a06dd6ad33b"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "14adde91e90011702483e943edf1044549252bd9",
"internalRef": "344906237"
"sha": "dd372aa22ded7a8ba6f0e03a80e06358a3fa0907",
"internalRef": "347055288"
}
},
{
Expand Down
8 changes: 8 additions & 0 deletions tests/unit/gapic/language_v1/test_language_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -1736,6 +1736,10 @@ def test_language_service_transport_channel_mtls_with_client_cert_source(
),
ssl_credentials=mock_ssl_cred,
quota_project_id=None,
options=[
("grpc.max_send_message_length", -1),
("grpc.max_receive_message_length", -1),
],
)
assert transport.grpc_channel == mock_grpc_channel
assert transport._ssl_channel_credentials == mock_ssl_cred
Expand Down Expand Up @@ -1780,6 +1784,10 @@ def test_language_service_transport_channel_mtls_with_adc(transport_class):
),
ssl_credentials=mock_ssl_cred,
quota_project_id=None,
options=[
("grpc.max_send_message_length", -1),
("grpc.max_receive_message_length", -1),
],
)
assert transport.grpc_channel == mock_grpc_channel

Expand Down
8 changes: 8 additions & 0 deletions tests/unit/gapic/language_v1beta2/test_language_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -1738,6 +1738,10 @@ def test_language_service_transport_channel_mtls_with_client_cert_source(
),
ssl_credentials=mock_ssl_cred,
quota_project_id=None,
options=[
("grpc.max_send_message_length", -1),
("grpc.max_receive_message_length", -1),
],
)
assert transport.grpc_channel == mock_grpc_channel
assert transport._ssl_channel_credentials == mock_ssl_cred
Expand Down Expand Up @@ -1782,6 +1786,10 @@ def test_language_service_transport_channel_mtls_with_adc(transport_class):
),
ssl_credentials=mock_ssl_cred,
quota_project_id=None,
options=[
("grpc.max_send_message_length", -1),
("grpc.max_receive_message_length", -1),
],
)
assert transport.grpc_channel == mock_grpc_channel

Expand Down

0 comments on commit 3476c0f

Please sign in to comment.