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

Commit

Permalink
fix: remove gRPC send/recv limits (#15)
Browse files Browse the repository at this point in the history
* changes without context

        autosynth cannot find the source of changes triggered by earlier changes in this
        repository, or by version upgrades to tools such as linters.

* fix: remove client recv msg limit fix: add enums to `types/__init__.py`

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
  • Loading branch information
yoshi-automation authored Jan 5, 2021
1 parent d090b4b commit 044d47a
Show file tree
Hide file tree
Showing 11 changed files with 59 additions and 10 deletions.
4 changes: 2 additions & 2 deletions google/cloud/dataqna_v1alpha/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@

__all__ = (
"AnnotatedString",
"AutoSuggestionServiceClient",
"BigQueryJob",
"CreateQuestionRequest",
"DataQuery",
Expand All @@ -58,12 +57,13 @@
"Interpretation",
"InterpretationStructure",
"Question",
"QuestionServiceClient",
"SuggestQueriesRequest",
"SuggestQueriesResponse",
"Suggestion",
"SuggestionInfo",
"SuggestionType",
"UpdateUserFeedbackRequest",
"UserFeedback",
"QuestionServiceClient",
"AutoSuggestionServiceClient",
)
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
_transport_registry["grpc"] = AutoSuggestionServiceGrpcTransport
_transport_registry["grpc_asyncio"] = AutoSuggestionServiceGrpcAsyncIOTransport


__all__ = (
"AutoSuggestionServiceTransport",
"AutoSuggestionServiceGrpcTransport",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,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 @@ -234,6 +238,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 @@ -260,7 +268,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 @@ -261,6 +261,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 @@ -279,6 +283,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
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
_transport_registry["grpc"] = QuestionServiceGrpcTransport
_transport_registry["grpc_asyncio"] = QuestionServiceGrpcAsyncIOTransport


__all__ = (
"QuestionServiceTransport",
"QuestionServiceGrpcTransport",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,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 @@ -184,6 +188,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 @@ -210,7 +218,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 @@ -211,6 +211,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 @@ -229,6 +233,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
5 changes: 4 additions & 1 deletion google/cloud/dataqna_v1alpha/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
Suggestion,
SuggestionInfo,
SuggestQueriesResponse,
SuggestionType,
)
from .question import (
Question,
Expand All @@ -32,6 +33,7 @@
HumanReadable,
InterpretationStructure,
DebugFlags,
InterpretEntity,
)
from .user_feedback import UserFeedback
from .question_service import (
Expand All @@ -42,13 +44,13 @@
UpdateUserFeedbackRequest,
)


__all__ = (
"AnnotatedString",
"SuggestQueriesRequest",
"Suggestion",
"SuggestionInfo",
"SuggestQueriesResponse",
"SuggestionType",
"Question",
"InterpretError",
"ExecutionInfo",
Expand All @@ -58,6 +60,7 @@
"HumanReadable",
"InterpretationStructure",
"DebugFlags",
"InterpretEntity",
"UserFeedback",
"GetQuestionRequest",
"CreateQuestionRequest",
Expand Down
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-data-qna.git",
"sha": "716cd7c25b330fe40ebd9ded097643779b579862"
"sha": "d090b4b19c2aa5185712c86ad189243c78420ca8"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "5fdb685a684269e07c10c7518372eb5d7b6bc0a9",
"internalRef": "342906697"
"sha": "dd372aa22ded7a8ba6f0e03a80e06358a3fa0907",
"internalRef": "347055288"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,10 @@ def test_auto_suggestion_service_transport_channel_mtls_with_client_cert_source(
scopes=("https://www.googleapis.com/auth/cloud-platform",),
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 @@ -875,6 +879,10 @@ def test_auto_suggestion_service_transport_channel_mtls_with_adc(transport_class
scopes=("https://www.googleapis.com/auth/cloud-platform",),
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/dataqna_v1alpha/test_question_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -1845,6 +1845,10 @@ def test_question_service_transport_channel_mtls_with_client_cert_source(
scopes=("https://www.googleapis.com/auth/cloud-platform",),
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 @@ -1886,6 +1890,10 @@ def test_question_service_transport_channel_mtls_with_adc(transport_class):
scopes=("https://www.googleapis.com/auth/cloud-platform",),
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 044d47a

Please sign in to comment.