Skip to content
This repository was archived by the owner on Sep 21, 2023. It is now read-only.

Commit 2d535da

Browse files
feat: update grpc service config settings to reflect correct API deadlines (#82)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 392712211 Source-Link: googleapis/googleapis@cb637a6 Source-Link: https://github.com/googleapis/googleapis-gen/commit/4c87ab9d52a5df08aa04dbfadaa01583fae5278b Release-As: 1.0.0
1 parent a77f0ea commit 2d535da

File tree

6 files changed

+87
-21
lines changed

6 files changed

+87
-21
lines changed

google/cloud/retail_v2/services/product_service/async_client.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,17 @@ async def import_products(
686686
# and friendly error handling.
687687
rpc = gapic_v1.method_async.wrap_method(
688688
self._client._transport.import_products,
689-
default_timeout=None,
689+
default_retry=retries.Retry(
690+
initial=0.1,
691+
maximum=300.0,
692+
multiplier=1.3,
693+
predicate=retries.if_exception_type(
694+
core_exceptions.DeadlineExceeded,
695+
core_exceptions.ServiceUnavailable,
696+
),
697+
deadline=300.0,
698+
),
699+
default_timeout=300.0,
690700
client_info=DEFAULT_CLIENT_INFO,
691701
)
692702

google/cloud/retail_v2/services/product_service/transports/base.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,19 @@ def _prep_wrapped_messages(self, client_info):
174174
self.delete_product, default_timeout=None, client_info=client_info,
175175
),
176176
self.import_products: gapic_v1.method.wrap_method(
177-
self.import_products, default_timeout=None, client_info=client_info,
177+
self.import_products,
178+
default_retry=retries.Retry(
179+
initial=0.1,
180+
maximum=300.0,
181+
multiplier=1.3,
182+
predicate=retries.if_exception_type(
183+
core_exceptions.DeadlineExceeded,
184+
core_exceptions.ServiceUnavailable,
185+
),
186+
deadline=300.0,
187+
),
188+
default_timeout=300.0,
189+
client_info=client_info,
178190
),
179191
self.set_inventory: gapic_v1.method.wrap_method(
180192
self.set_inventory, default_timeout=None, client_info=client_info,

google/cloud/retail_v2/services/user_event_service/async_client.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,17 @@ async def purge_user_events(
361361
# and friendly error handling.
362362
rpc = gapic_v1.method_async.wrap_method(
363363
self._client._transport.purge_user_events,
364-
default_timeout=None,
364+
default_retry=retries.Retry(
365+
initial=0.1,
366+
maximum=30.0,
367+
multiplier=1.3,
368+
predicate=retries.if_exception_type(
369+
core_exceptions.DeadlineExceeded,
370+
core_exceptions.ServiceUnavailable,
371+
),
372+
deadline=30.0,
373+
),
374+
default_timeout=30.0,
365375
client_info=DEFAULT_CLIENT_INFO,
366376
)
367377

@@ -429,7 +439,17 @@ async def import_user_events(
429439
# and friendly error handling.
430440
rpc = gapic_v1.method_async.wrap_method(
431441
self._client._transport.import_user_events,
432-
default_timeout=None,
442+
default_retry=retries.Retry(
443+
initial=0.1,
444+
maximum=300.0,
445+
multiplier=1.3,
446+
predicate=retries.if_exception_type(
447+
core_exceptions.DeadlineExceeded,
448+
core_exceptions.ServiceUnavailable,
449+
),
450+
deadline=300.0,
451+
),
452+
default_timeout=300.0,
433453
client_info=DEFAULT_CLIENT_INFO,
434454
)
435455

google/cloud/retail_v2/services/user_event_service/transports/base.py

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,34 @@ def _prep_wrapped_messages(self, client_info):
165165
self.collect_user_event, default_timeout=None, client_info=client_info,
166166
),
167167
self.purge_user_events: gapic_v1.method.wrap_method(
168-
self.purge_user_events, default_timeout=None, client_info=client_info,
168+
self.purge_user_events,
169+
default_retry=retries.Retry(
170+
initial=0.1,
171+
maximum=30.0,
172+
multiplier=1.3,
173+
predicate=retries.if_exception_type(
174+
core_exceptions.DeadlineExceeded,
175+
core_exceptions.ServiceUnavailable,
176+
),
177+
deadline=30.0,
178+
),
179+
default_timeout=30.0,
180+
client_info=client_info,
169181
),
170182
self.import_user_events: gapic_v1.method.wrap_method(
171-
self.import_user_events, default_timeout=None, client_info=client_info,
183+
self.import_user_events,
184+
default_retry=retries.Retry(
185+
initial=0.1,
186+
maximum=300.0,
187+
multiplier=1.3,
188+
predicate=retries.if_exception_type(
189+
core_exceptions.DeadlineExceeded,
190+
core_exceptions.ServiceUnavailable,
191+
),
192+
deadline=300.0,
193+
),
194+
default_timeout=300.0,
195+
client_info=client_info,
172196
),
173197
self.rejoin_user_events: gapic_v1.method.wrap_method(
174198
self.rejoin_user_events, default_timeout=None, client_info=client_info,

google/cloud/retail_v2/types/product.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ class Product(proto.Message):
132132
limit of 128 characters. Otherwise, an INVALID_ARGUMENT
133133
error is returned.
134134
135+
This field must be a Unigram. Otherwise, an INVALID_ARGUMENT
136+
error is returned.
137+
135138
Google Merchant Center property
136139
`gtin <https://support.google.com/merchants/answer/6324461>`__.
137140
Schema.org property
@@ -376,7 +379,7 @@ class Product(proto.Message):
376379
The pattern or graphic print of the product. For example,
377380
"striped", "polka dot", "paisley".
378381
379-
A maximum of 5 values are allowed per
382+
A maximum of 20 values are allowed per
380383
[Product][google.cloud.retail.v2.Product]. Each value must
381384
be a UTF-8 encoded string with a length limit of 128
382385
characters. Otherwise, an INVALID_ARGUMENT error is

google/cloud/retail_v2/types/search_service.py

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ class SearchRequest(proto.Message):
9494
The filter syntax consists of an expression language for
9595
constructing a predicate from one or more fields of the
9696
products being filtered. Filter expression is
97-
case-sensitive. See more details at this `user
98-
guide </retail/private/docs/filter-and-order#filter>`__.
97+
case-sensitive.
9998
10099
If this field is unrecognizable, an INVALID_ARGUMENT is
101100
returned.
@@ -117,8 +116,7 @@ class SearchRequest(proto.Message):
117116
ordered by a field in an
118117
[Product][google.cloud.retail.v2.Product] object. Leave it
119118
unset if ordered by relevance. OrderBy expression is
120-
case-sensitive. See more details at this `user
121-
guide </retail/private/docs/filter-and-order#order>`__.
119+
case-sensitive.
122120
123121
If this field is unrecognizable, an INVALID_ARGUMENT is
124122
returned.
@@ -136,14 +134,12 @@ class SearchRequest(proto.Message):
136134
Contact Retail Search support team if you are
137135
interested in using dynamic facet feature.
138136
boost_spec (google.cloud.retail_v2.types.SearchRequest.BoostSpec):
139-
Boost specification to boost certain products. See more
140-
details at this `user
141-
guide </retail/private/docs/boosting>`__.
137+
Boost specification to boost certain
138+
products.
142139
query_expansion_spec (google.cloud.retail_v2.types.SearchRequest.QueryExpansionSpec):
143-
The query expansion specification that specifies the
144-
conditions under which query expansion will occur. See more
145-
details at this `user
146-
guide </retail/private/docs/result-size#query_expansion>`__.
140+
The query expansion specification that
141+
specifies the conditions under which query
142+
expansion will occur.
147143
variant_rollup_keys (Sequence[str]):
148144
The keys to fetch and rollup the matching
149145
[variant][google.cloud.retail.v2.Product.Type.VARIANT]
@@ -501,9 +497,10 @@ class ConditionBoostSpec(proto.Message):
501497
Examples:
502498
503499
- To boost products with product ID "product_1" or
504-
"product_2", and color "Red" or "Blue": *(id:
505-
ANY("product_1", "product_2"))* *AND* *(colorFamilies:
506-
ANY("Red", "Blue"))*
500+
"product_2", and color "Red" or "Blue":
501+
502+
- (id: ANY("product_1", "product_2")) AND
503+
(colorFamilies: ANY("Red","Blue"))
507504
boost (float):
508505
Strength of the condition boost, which should be in [-1, 1].
509506
Negative boost means demotion. Default is 0.0.

0 commit comments

Comments
 (0)