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

fix: remove gRPC send/recv limits; add enums to types/__init__.py #89

Merged
merged 2 commits into from Dec 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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
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
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",
)