diff --git a/bigquery_storage/google/cloud/bigquery_storage_v1beta1/gapic/transports/big_query_storage_grpc_transport.py b/bigquery_storage/google/cloud/bigquery_storage_v1beta1/gapic/transports/big_query_storage_grpc_transport.py index 01cd7193b442..73ac2d16d5b9 100644 --- a/bigquery_storage/google/cloud/bigquery_storage_v1beta1/gapic/transports/big_query_storage_grpc_transport.py +++ b/bigquery_storage/google/cloud/bigquery_storage_v1beta1/gapic/transports/big_query_storage_grpc_transport.py @@ -91,7 +91,13 @@ def create_channel( grpc.Channel: A gRPC channel object. """ return google.api_core.grpc_helpers.create_channel( # pragma: no cover - address, credentials=credentials, scopes=cls._OAUTH_SCOPES + address, + credentials=credentials, + scopes=cls._OAUTH_SCOPES, + options={ + "grpc.max_send_message_length": -1, + "grpc.max_receive_message_length": -1, + }.items(), ) @property diff --git a/bigquery_storage/synth.py b/bigquery_storage/synth.py index 252e4bc53b06..fb8da2c7005e 100644 --- a/bigquery_storage/synth.py +++ b/bigquery_storage/synth.py @@ -75,6 +75,17 @@ "big_query_storage_client.BigQueryStorageClient", ) +# The grpc transport channel shouldn't limit the size of a grpc message at the +# default 4mb. +s.replace("google/cloud/bigquery_storage_v1beta1/gapic/transports/*_grpc_transport.py", + "return google.api_core.grpc_helpers.create_channel\(\n(\s+)address,\n" + "\s+credentials=.*,\n\s+scopes=.*,\n", + "\g<0>\g<1>options={\n" + "\g<1> 'grpc.max_send_message_length': -1,\n" + "\g<1> 'grpc.max_receive_message_length': -1,\n" + "\g<1>}.items(),\n", +) + # START: Ignore lint and coverage s.replace( ["google/cloud/bigquery_storage_v1beta1/gapic/big_query_storage_client.py"],