From c8e4e495a633e3b8ea824acb68b6fc41ea3c8a63 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 28 Dec 2020 10:28:26 -0800 Subject: [PATCH] fix: remove grpc send/recv limit (#62) --- .../services/budget_service/transports/__init__.py | 1 - .../services/budget_service/transports/grpc.py | 10 +++++++++- .../services/budget_service/transports/grpc_asyncio.py | 8 ++++++++ .../google/cloud/billing/budgets_v1/types/__init__.py | 1 - .../services/budget_service/transports/__init__.py | 1 - .../services/budget_service/transports/grpc.py | 10 +++++++++- .../services/budget_service/transports/grpc_asyncio.py | 8 ++++++++ .../cloud/billing/budgets_v1beta1/types/__init__.py | 1 - packages/google-cloud-billing-budgets/synth.metadata | 6 +++--- .../tests/unit/gapic/budgets_v1/test_budget_service.py | 8 ++++++++ .../unit/gapic/budgets_v1beta1/test_budget_service.py | 8 ++++++++ 11 files changed, 53 insertions(+), 9 deletions(-) diff --git a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/transports/__init__.py b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/transports/__init__.py index 8f54d9e1cf8b..0ab5ac170d4b 100644 --- a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/transports/__init__.py +++ b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/transports/__init__.py @@ -28,7 +28,6 @@ _transport_registry["grpc"] = BudgetServiceGrpcTransport _transport_registry["grpc_asyncio"] = BudgetServiceGrpcAsyncIOTransport - __all__ = ( "BudgetServiceTransport", "BudgetServiceGrpcTransport", diff --git a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/transports/grpc.py b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/transports/grpc.py index ec12f7c9577b..9da459da171f 100644 --- a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/transports/grpc.py +++ b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/transports/grpc.py @@ -150,6 +150,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: @@ -168,6 +172,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] @@ -194,7 +202,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 diff --git a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/transports/grpc_asyncio.py b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/transports/grpc_asyncio.py index 4a007b71180c..6f365d0bc773 100644 --- a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/transports/grpc_asyncio.py +++ b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/transports/grpc_asyncio.py @@ -195,6 +195,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: @@ -213,6 +217,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. diff --git a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/types/__init__.py b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/types/__init__.py index 6720cb44f8e4..52e66d63a903 100644 --- a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/types/__init__.py +++ b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/types/__init__.py @@ -32,7 +32,6 @@ DeleteBudgetRequest, ) - __all__ = ( "Budget", "BudgetAmount", diff --git a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/transports/__init__.py b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/transports/__init__.py index 8f54d9e1cf8b..0ab5ac170d4b 100644 --- a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/transports/__init__.py +++ b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/transports/__init__.py @@ -28,7 +28,6 @@ _transport_registry["grpc"] = BudgetServiceGrpcTransport _transport_registry["grpc_asyncio"] = BudgetServiceGrpcAsyncIOTransport - __all__ = ( "BudgetServiceTransport", "BudgetServiceGrpcTransport", diff --git a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/transports/grpc.py b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/transports/grpc.py index d926f9a6db6a..6d7ab32cb87f 100644 --- a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/transports/grpc.py +++ b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/transports/grpc.py @@ -150,6 +150,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: @@ -168,6 +172,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] @@ -194,7 +202,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 diff --git a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/transports/grpc_asyncio.py b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/transports/grpc_asyncio.py index d0f6a217af2e..c84197df9de5 100644 --- a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/transports/grpc_asyncio.py +++ b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/transports/grpc_asyncio.py @@ -195,6 +195,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: @@ -213,6 +217,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. diff --git a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/types/__init__.py b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/types/__init__.py index 02b0409865c8..4e7b3b3125bc 100644 --- a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/types/__init__.py +++ b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/types/__init__.py @@ -32,7 +32,6 @@ DeleteBudgetRequest, ) - __all__ = ( "Budget", "BudgetAmount", diff --git a/packages/google-cloud-billing-budgets/synth.metadata b/packages/google-cloud-billing-budgets/synth.metadata index ae6c4fd5a315..90d98772d1a0 100644 --- a/packages/google-cloud-billing-budgets/synth.metadata +++ b/packages/google-cloud-billing-budgets/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/python-billingbudgets.git", - "sha": "4c62f9c89128f70f84ef886345feeb7cb45b4888" + "sha": "409385ccda7bbdfc5185d19297b057ecde7185c1" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "6c0f55f33f882cf97fd3135e93b144ad9c94ebab", - "internalRef": "341478628" + "sha": "dd372aa22ded7a8ba6f0e03a80e06358a3fa0907", + "internalRef": "347055288" } }, { diff --git a/packages/google-cloud-billing-budgets/tests/unit/gapic/budgets_v1/test_budget_service.py b/packages/google-cloud-billing-budgets/tests/unit/gapic/budgets_v1/test_budget_service.py index 324fe399d49c..58bc53a403f6 100644 --- a/packages/google-cloud-billing-budgets/tests/unit/gapic/budgets_v1/test_budget_service.py +++ b/packages/google-cloud-billing-budgets/tests/unit/gapic/budgets_v1/test_budget_service.py @@ -1837,6 +1837,10 @@ def test_budget_service_transport_channel_mtls_with_client_cert_source(transport ), 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 @@ -1881,6 +1885,10 @@ def test_budget_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 diff --git a/packages/google-cloud-billing-budgets/tests/unit/gapic/budgets_v1beta1/test_budget_service.py b/packages/google-cloud-billing-budgets/tests/unit/gapic/budgets_v1beta1/test_budget_service.py index 79ffd3b61974..42a2f9ab3cba 100644 --- a/packages/google-cloud-billing-budgets/tests/unit/gapic/budgets_v1beta1/test_budget_service.py +++ b/packages/google-cloud-billing-budgets/tests/unit/gapic/budgets_v1beta1/test_budget_service.py @@ -1486,6 +1486,10 @@ def test_budget_service_transport_channel_mtls_with_client_cert_source(transport ), 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 @@ -1530,6 +1534,10 @@ def test_budget_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