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

Commit

Permalink
fix: remove gRPC send/recv limits; add enums to types/__init__.py (#89
Browse files Browse the repository at this point in the history
)
  • Loading branch information
yoshi-automation authored Dec 28, 2020
1 parent bb995c7 commit 76e0439
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 412 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
_transport_registry["grpc"] = DlpServiceGrpcTransport
_transport_registry["grpc_asyncio"] = DlpServiceGrpcAsyncIOTransport


__all__ = (
"DlpServiceTransport",
"DlpServiceGrpcTransport",
Expand Down
10 changes: 9 additions & 1 deletion google/cloud/dlp_v2/services/dlp_service/transports/grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,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 @@ -173,6 +177,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 @@ -199,7 +207,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 @@ -200,6 +200,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 @@ -218,6 +222,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
19 changes: 18 additions & 1 deletion google/cloud/dlp_v2/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
BigQueryField,
EntityId,
TableOptions,
Likelihood,
FileType,
)
from .dlp import (
ExcludeInfoTypes,
Expand Down Expand Up @@ -164,9 +166,15 @@
HybridContentItem,
HybridFindingDetails,
HybridInspectResponse,
RelationalOperator,
MatchingType,
ContentOption,
MetadataType,
InfoTypeSupportedBy,
DlpJobType,
StoredInfoTypeState,
)


__all__ = (
"InfoType",
"StoredType",
Expand All @@ -190,6 +198,8 @@
"BigQueryField",
"EntityId",
"TableOptions",
"Likelihood",
"FileType",
"ExcludeInfoTypes",
"ExclusionRule",
"InspectionRule",
Expand Down Expand Up @@ -314,4 +324,11 @@
"HybridContentItem",
"HybridFindingDetails",
"HybridInspectResponse",
"RelationalOperator",
"MatchingType",
"ContentOption",
"MetadataType",
"InfoTypeSupportedBy",
"DlpJobType",
"StoredInfoTypeState",
)
Loading

0 comments on commit 76e0439

Please sign in to comment.