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

feat: update grpc service config settings to reflect correct API deadlines #82

Merged
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
12 changes: 11 additions & 1 deletion google/cloud/retail_v2/services/product_service/async_client.py
Expand Up @@ -686,7 +686,17 @@ async def import_products(
# and friendly error handling.
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.import_products,
default_timeout=None,
default_retry=retries.Retry(
initial=0.1,
maximum=300.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=300.0,
),
default_timeout=300.0,
client_info=DEFAULT_CLIENT_INFO,
)

Expand Down
Expand Up @@ -174,7 +174,19 @@ def _prep_wrapped_messages(self, client_info):
self.delete_product, default_timeout=None, client_info=client_info,
),
self.import_products: gapic_v1.method.wrap_method(
self.import_products, default_timeout=None, client_info=client_info,
self.import_products,
default_retry=retries.Retry(
initial=0.1,
maximum=300.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=300.0,
),
default_timeout=300.0,
client_info=client_info,
),
self.set_inventory: gapic_v1.method.wrap_method(
self.set_inventory, default_timeout=None, client_info=client_info,
Expand Down
24 changes: 22 additions & 2 deletions google/cloud/retail_v2/services/user_event_service/async_client.py
Expand Up @@ -361,7 +361,17 @@ async def purge_user_events(
# and friendly error handling.
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.purge_user_events,
default_timeout=None,
default_retry=retries.Retry(
initial=0.1,
maximum=30.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=30.0,
),
default_timeout=30.0,
client_info=DEFAULT_CLIENT_INFO,
)

Expand Down Expand Up @@ -429,7 +439,17 @@ async def import_user_events(
# and friendly error handling.
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.import_user_events,
default_timeout=None,
default_retry=retries.Retry(
initial=0.1,
maximum=300.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=300.0,
),
default_timeout=300.0,
client_info=DEFAULT_CLIENT_INFO,
)

Expand Down
Expand Up @@ -165,10 +165,34 @@ def _prep_wrapped_messages(self, client_info):
self.collect_user_event, default_timeout=None, client_info=client_info,
),
self.purge_user_events: gapic_v1.method.wrap_method(
self.purge_user_events, default_timeout=None, client_info=client_info,
self.purge_user_events,
default_retry=retries.Retry(
initial=0.1,
maximum=30.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=30.0,
),
default_timeout=30.0,
client_info=client_info,
),
self.import_user_events: gapic_v1.method.wrap_method(
self.import_user_events, default_timeout=None, client_info=client_info,
self.import_user_events,
default_retry=retries.Retry(
initial=0.1,
maximum=300.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=300.0,
),
default_timeout=300.0,
client_info=client_info,
),
self.rejoin_user_events: gapic_v1.method.wrap_method(
self.rejoin_user_events, default_timeout=None, client_info=client_info,
Expand Down
5 changes: 4 additions & 1 deletion google/cloud/retail_v2/types/product.py
Expand Up @@ -132,6 +132,9 @@ class Product(proto.Message):
limit of 128 characters. Otherwise, an INVALID_ARGUMENT
error is returned.

This field must be a Unigram. Otherwise, an INVALID_ARGUMENT
error is returned.

Google Merchant Center property
`gtin <https://support.google.com/merchants/answer/6324461>`__.
Schema.org property
Expand Down Expand Up @@ -376,7 +379,7 @@ class Product(proto.Message):
The pattern or graphic print of the product. For example,
"striped", "polka dot", "paisley".

A maximum of 5 values are allowed per
A maximum of 20 values are allowed per
[Product][google.cloud.retail.v2.Product]. Each value must
be a UTF-8 encoded string with a length limit of 128
characters. Otherwise, an INVALID_ARGUMENT error is
Expand Down
25 changes: 11 additions & 14 deletions google/cloud/retail_v2/types/search_service.py
Expand Up @@ -94,8 +94,7 @@ class SearchRequest(proto.Message):
The filter syntax consists of an expression language for
constructing a predicate from one or more fields of the
products being filtered. Filter expression is
case-sensitive. See more details at this `user
guide </retail/private/docs/filter-and-order#filter>`__.
case-sensitive.

If this field is unrecognizable, an INVALID_ARGUMENT is
returned.
Expand All @@ -117,8 +116,7 @@ class SearchRequest(proto.Message):
ordered by a field in an
[Product][google.cloud.retail.v2.Product] object. Leave it
unset if ordered by relevance. OrderBy expression is
case-sensitive. See more details at this `user
guide </retail/private/docs/filter-and-order#order>`__.
case-sensitive.

If this field is unrecognizable, an INVALID_ARGUMENT is
returned.
Expand All @@ -136,14 +134,12 @@ class SearchRequest(proto.Message):
Contact Retail Search support team if you are
interested in using dynamic facet feature.
boost_spec (google.cloud.retail_v2.types.SearchRequest.BoostSpec):
Boost specification to boost certain products. See more
details at this `user
guide </retail/private/docs/boosting>`__.
Boost specification to boost certain
products.
query_expansion_spec (google.cloud.retail_v2.types.SearchRequest.QueryExpansionSpec):
The query expansion specification that specifies the
conditions under which query expansion will occur. See more
details at this `user
guide </retail/private/docs/result-size#query_expansion>`__.
The query expansion specification that
specifies the conditions under which query
expansion will occur.
variant_rollup_keys (Sequence[str]):
The keys to fetch and rollup the matching
[variant][google.cloud.retail.v2.Product.Type.VARIANT]
Expand Down Expand Up @@ -501,9 +497,10 @@ class ConditionBoostSpec(proto.Message):
Examples:

- To boost products with product ID "product_1" or
"product_2", and color "Red" or "Blue": *(id:
ANY("product_1", "product_2"))* *AND* *(colorFamilies:
ANY("Red", "Blue"))*
"product_2", and color "Red" or "Blue":

- (id: ANY("product_1", "product_2")) AND
(colorFamilies: ANY("Red","Blue"))
boost (float):
Strength of the condition boost, which should be in [-1, 1].
Negative boost means demotion. Default is 0.0.
Expand Down