Skip to content

Commit 8613918

Browse files
authored
Increase payload and metadata size defaults for all service transports. (googleads#133)
1 parent ca3f821 commit 8613918

102 files changed

Lines changed: 1007 additions & 572 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

google/ads/google_ads/client.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
_VALID_API_VERSIONS = ['v1']
3535
_DEFAULT_VERSION = _VALID_API_VERSIONS[0]
3636
_REQUEST_ID_KEY = 'request-id'
37+
GRPC_CHANNEL_OPTIONS = [
38+
('grpc.max_metadata_size', 16 * 1024 * 1024),
39+
('grpc.max_receive_message_length', 64 * 1024 * 1024)]
3740

3841
class GoogleAdsClient(object):
3942
"""Google Ads client used to configure settings and fetch services."""
@@ -195,7 +198,8 @@ def get_service(self, name, version=_DEFAULT_VERSION):
195198

196199
channel = service_transport_class.create_channel(
197200
address=endpoint,
198-
credentials=self.credentials)
201+
credentials=self.credentials,
202+
options=GRPC_CHANNEL_OPTIONS)
199203

200204
channel = grpc.intercept_channel(
201205
channel,

google/ads/google_ads/v1/services/transports/account_budget_proposal_service_grpc_transport.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,16 @@ def __init__(self,
6767
# gRPC uses objects called "stubs" that are bound to the
6868
# channel and provide a basic method for each RPC.
6969
self._stubs = {
70-
'account_budget_proposal_service_stub':
71-
account_budget_proposal_service_pb2_grpc.
72-
AccountBudgetProposalServiceStub(channel),
70+
'account_budget_proposal_service_stub': account_budget_proposal_service_pb2_grpc.AccountBudgetProposalServiceStub(channel),
7371
}
7472

73+
7574
@classmethod
76-
def create_channel(cls,
77-
address='googleads.googleapis.com:443',
78-
credentials=None):
75+
def create_channel(
76+
cls,
77+
address='googleads.googleapis.com:443',
78+
credentials=None,
79+
**kwargs):
7980
"""Create and return a gRPC channel object.
8081
8182
Args:
@@ -85,6 +86,8 @@ def create_channel(cls,
8586
credentials identify this application to the service. If
8687
none are specified, the client will attempt to ascertain
8788
the credentials from the environment.
89+
kwargs (dict): Keyword arguments, which are passed to the
90+
channel creation.
8891
8992
Returns:
9093
grpc.Channel: A gRPC channel object.
@@ -93,6 +96,7 @@ def create_channel(cls,
9396
address,
9497
credentials=credentials,
9598
scopes=cls._OAUTH_SCOPES,
99+
**kwargs
96100
)
97101

98102
@property

google/ads/google_ads/v1/services/transports/account_budget_service_grpc_transport.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,16 @@ def __init__(self,
6767
# gRPC uses objects called "stubs" that are bound to the
6868
# channel and provide a basic method for each RPC.
6969
self._stubs = {
70-
'account_budget_service_stub':
71-
account_budget_service_pb2_grpc.AccountBudgetServiceStub(channel),
70+
'account_budget_service_stub': account_budget_service_pb2_grpc.AccountBudgetServiceStub(channel),
7271
}
7372

73+
7474
@classmethod
75-
def create_channel(cls,
76-
address='googleads.googleapis.com:443',
77-
credentials=None):
75+
def create_channel(
76+
cls,
77+
address='googleads.googleapis.com:443',
78+
credentials=None,
79+
**kwargs):
7880
"""Create and return a gRPC channel object.
7981
8082
Args:
@@ -84,6 +86,8 @@ def create_channel(cls,
8486
credentials identify this application to the service. If
8587
none are specified, the client will attempt to ascertain
8688
the credentials from the environment.
89+
kwargs (dict): Keyword arguments, which are passed to the
90+
channel creation.
8791
8892
Returns:
8993
grpc.Channel: A gRPC channel object.
@@ -92,6 +96,7 @@ def create_channel(cls,
9296
address,
9397
credentials=credentials,
9498
scopes=cls._OAUTH_SCOPES,
99+
**kwargs
95100
)
96101

97102
@property

google/ads/google_ads/v1/services/transports/ad_group_ad_label_service_grpc_transport.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,16 @@ def __init__(self,
6767
# gRPC uses objects called "stubs" that are bound to the
6868
# channel and provide a basic method for each RPC.
6969
self._stubs = {
70-
'ad_group_ad_label_service_stub':
71-
ad_group_ad_label_service_pb2_grpc.AdGroupAdLabelServiceStub(
72-
channel),
70+
'ad_group_ad_label_service_stub': ad_group_ad_label_service_pb2_grpc.AdGroupAdLabelServiceStub(channel),
7371
}
7472

73+
7574
@classmethod
76-
def create_channel(cls,
77-
address='googleads.googleapis.com:443',
78-
credentials=None):
75+
def create_channel(
76+
cls,
77+
address='googleads.googleapis.com:443',
78+
credentials=None,
79+
**kwargs):
7980
"""Create and return a gRPC channel object.
8081
8182
Args:
@@ -85,6 +86,8 @@ def create_channel(cls,
8586
credentials identify this application to the service. If
8687
none are specified, the client will attempt to ascertain
8788
the credentials from the environment.
89+
kwargs (dict): Keyword arguments, which are passed to the
90+
channel creation.
8891
8992
Returns:
9093
grpc.Channel: A gRPC channel object.
@@ -93,6 +96,7 @@ def create_channel(cls,
9396
address,
9497
credentials=credentials,
9598
scopes=cls._OAUTH_SCOPES,
99+
**kwargs
96100
)
97101

98102
@property

google/ads/google_ads/v1/services/transports/ad_group_ad_service_grpc_transport.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,16 @@ def __init__(self,
6767
# gRPC uses objects called "stubs" that are bound to the
6868
# channel and provide a basic method for each RPC.
6969
self._stubs = {
70-
'ad_group_ad_service_stub':
71-
ad_group_ad_service_pb2_grpc.AdGroupAdServiceStub(channel),
70+
'ad_group_ad_service_stub': ad_group_ad_service_pb2_grpc.AdGroupAdServiceStub(channel),
7271
}
7372

73+
7474
@classmethod
75-
def create_channel(cls,
76-
address='googleads.googleapis.com:443',
77-
credentials=None):
75+
def create_channel(
76+
cls,
77+
address='googleads.googleapis.com:443',
78+
credentials=None,
79+
**kwargs):
7880
"""Create and return a gRPC channel object.
7981
8082
Args:
@@ -84,6 +86,8 @@ def create_channel(cls,
8486
credentials identify this application to the service. If
8587
none are specified, the client will attempt to ascertain
8688
the credentials from the environment.
89+
kwargs (dict): Keyword arguments, which are passed to the
90+
channel creation.
8791
8892
Returns:
8993
grpc.Channel: A gRPC channel object.
@@ -92,6 +96,7 @@ def create_channel(cls,
9296
address,
9397
credentials=credentials,
9498
scopes=cls._OAUTH_SCOPES,
99+
**kwargs
95100
)
96101

97102
@property

google/ads/google_ads/v1/services/transports/ad_group_audience_view_service_grpc_transport.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,16 @@ def __init__(self,
6767
# gRPC uses objects called "stubs" that are bound to the
6868
# channel and provide a basic method for each RPC.
6969
self._stubs = {
70-
'ad_group_audience_view_service_stub':
71-
ad_group_audience_view_service_pb2_grpc.
72-
AdGroupAudienceViewServiceStub(channel),
70+
'ad_group_audience_view_service_stub': ad_group_audience_view_service_pb2_grpc.AdGroupAudienceViewServiceStub(channel),
7371
}
7472

73+
7574
@classmethod
76-
def create_channel(cls,
77-
address='googleads.googleapis.com:443',
78-
credentials=None):
75+
def create_channel(
76+
cls,
77+
address='googleads.googleapis.com:443',
78+
credentials=None,
79+
**kwargs):
7980
"""Create and return a gRPC channel object.
8081
8182
Args:
@@ -85,6 +86,8 @@ def create_channel(cls,
8586
credentials identify this application to the service. If
8687
none are specified, the client will attempt to ascertain
8788
the credentials from the environment.
89+
kwargs (dict): Keyword arguments, which are passed to the
90+
channel creation.
8891
8992
Returns:
9093
grpc.Channel: A gRPC channel object.
@@ -93,6 +96,7 @@ def create_channel(cls,
9396
address,
9497
credentials=credentials,
9598
scopes=cls._OAUTH_SCOPES,
99+
**kwargs
96100
)
97101

98102
@property

google/ads/google_ads/v1/services/transports/ad_group_bid_modifier_service_grpc_transport.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,16 @@ def __init__(self,
6767
# gRPC uses objects called "stubs" that are bound to the
6868
# channel and provide a basic method for each RPC.
6969
self._stubs = {
70-
'ad_group_bid_modifier_service_stub':
71-
ad_group_bid_modifier_service_pb2_grpc.
72-
AdGroupBidModifierServiceStub(channel),
70+
'ad_group_bid_modifier_service_stub': ad_group_bid_modifier_service_pb2_grpc.AdGroupBidModifierServiceStub(channel),
7371
}
7472

73+
7574
@classmethod
76-
def create_channel(cls,
77-
address='googleads.googleapis.com:443',
78-
credentials=None):
75+
def create_channel(
76+
cls,
77+
address='googleads.googleapis.com:443',
78+
credentials=None,
79+
**kwargs):
7980
"""Create and return a gRPC channel object.
8081
8182
Args:
@@ -85,6 +86,8 @@ def create_channel(cls,
8586
credentials identify this application to the service. If
8687
none are specified, the client will attempt to ascertain
8788
the credentials from the environment.
89+
kwargs (dict): Keyword arguments, which are passed to the
90+
channel creation.
8891
8992
Returns:
9093
grpc.Channel: A gRPC channel object.
@@ -93,6 +96,7 @@ def create_channel(cls,
9396
address,
9497
credentials=credentials,
9598
scopes=cls._OAUTH_SCOPES,
99+
**kwargs
96100
)
97101

98102
@property

google/ads/google_ads/v1/services/transports/ad_group_criterion_label_service_grpc_transport.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,16 @@ def __init__(self,
6767
# gRPC uses objects called "stubs" that are bound to the
6868
# channel and provide a basic method for each RPC.
6969
self._stubs = {
70-
'ad_group_criterion_label_service_stub':
71-
ad_group_criterion_label_service_pb2_grpc.
72-
AdGroupCriterionLabelServiceStub(channel),
70+
'ad_group_criterion_label_service_stub': ad_group_criterion_label_service_pb2_grpc.AdGroupCriterionLabelServiceStub(channel),
7371
}
7472

73+
7574
@classmethod
76-
def create_channel(cls,
77-
address='googleads.googleapis.com:443',
78-
credentials=None):
75+
def create_channel(
76+
cls,
77+
address='googleads.googleapis.com:443',
78+
credentials=None,
79+
**kwargs):
7980
"""Create and return a gRPC channel object.
8081
8182
Args:
@@ -85,6 +86,8 @@ def create_channel(cls,
8586
credentials identify this application to the service. If
8687
none are specified, the client will attempt to ascertain
8788
the credentials from the environment.
89+
kwargs (dict): Keyword arguments, which are passed to the
90+
channel creation.
8891
8992
Returns:
9093
grpc.Channel: A gRPC channel object.
@@ -93,6 +96,7 @@ def create_channel(cls,
9396
address,
9497
credentials=credentials,
9598
scopes=cls._OAUTH_SCOPES,
99+
**kwargs
96100
)
97101

98102
@property

google/ads/google_ads/v1/services/transports/ad_group_criterion_service_grpc_transport.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,16 @@ def __init__(self,
6767
# gRPC uses objects called "stubs" that are bound to the
6868
# channel and provide a basic method for each RPC.
6969
self._stubs = {
70-
'ad_group_criterion_service_stub':
71-
ad_group_criterion_service_pb2_grpc.AdGroupCriterionServiceStub(
72-
channel),
70+
'ad_group_criterion_service_stub': ad_group_criterion_service_pb2_grpc.AdGroupCriterionServiceStub(channel),
7371
}
7472

73+
7574
@classmethod
76-
def create_channel(cls,
77-
address='googleads.googleapis.com:443',
78-
credentials=None):
75+
def create_channel(
76+
cls,
77+
address='googleads.googleapis.com:443',
78+
credentials=None,
79+
**kwargs):
7980
"""Create and return a gRPC channel object.
8081
8182
Args:
@@ -85,6 +86,8 @@ def create_channel(cls,
8586
credentials identify this application to the service. If
8687
none are specified, the client will attempt to ascertain
8788
the credentials from the environment.
89+
kwargs (dict): Keyword arguments, which are passed to the
90+
channel creation.
8891
8992
Returns:
9093
grpc.Channel: A gRPC channel object.
@@ -93,6 +96,7 @@ def create_channel(cls,
9396
address,
9497
credentials=credentials,
9598
scopes=cls._OAUTH_SCOPES,
99+
**kwargs
96100
)
97101

98102
@property

google/ads/google_ads/v1/services/transports/ad_group_criterion_simulation_service_grpc_transport.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,16 @@ def __init__(self,
6767
# gRPC uses objects called "stubs" that are bound to the
6868
# channel and provide a basic method for each RPC.
6969
self._stubs = {
70-
'ad_group_criterion_simulation_service_stub':
71-
ad_group_criterion_simulation_service_pb2_grpc.
72-
AdGroupCriterionSimulationServiceStub(channel),
70+
'ad_group_criterion_simulation_service_stub': ad_group_criterion_simulation_service_pb2_grpc.AdGroupCriterionSimulationServiceStub(channel),
7371
}
7472

73+
7574
@classmethod
76-
def create_channel(cls,
77-
address='googleads.googleapis.com:443',
78-
credentials=None):
75+
def create_channel(
76+
cls,
77+
address='googleads.googleapis.com:443',
78+
credentials=None,
79+
**kwargs):
7980
"""Create and return a gRPC channel object.
8081
8182
Args:
@@ -85,6 +86,8 @@ def create_channel(cls,
8586
credentials identify this application to the service. If
8687
none are specified, the client will attempt to ascertain
8788
the credentials from the environment.
89+
kwargs (dict): Keyword arguments, which are passed to the
90+
channel creation.
8891
8992
Returns:
9093
grpc.Channel: A gRPC channel object.
@@ -93,6 +96,7 @@ def create_channel(cls,
9396
address,
9497
credentials=credentials,
9598
scopes=cls._OAUTH_SCOPES,
99+
**kwargs
96100
)
97101

98102
@property

0 commit comments

Comments
 (0)