diff --git a/packages/google-cloud-retail/google/cloud/retail_v2/services/product_service/async_client.py b/packages/google-cloud-retail/google/cloud/retail_v2/services/product_service/async_client.py index dfb748416209..288a418c0550 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2/services/product_service/async_client.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2/services/product_service/async_client.py @@ -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, ) diff --git a/packages/google-cloud-retail/google/cloud/retail_v2/services/product_service/transports/base.py b/packages/google-cloud-retail/google/cloud/retail_v2/services/product_service/transports/base.py index 75a390f243c8..ef92274ea8a1 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2/services/product_service/transports/base.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2/services/product_service/transports/base.py @@ -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, diff --git a/packages/google-cloud-retail/google/cloud/retail_v2/services/user_event_service/async_client.py b/packages/google-cloud-retail/google/cloud/retail_v2/services/user_event_service/async_client.py index 118181f86de5..beccce6598ea 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2/services/user_event_service/async_client.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2/services/user_event_service/async_client.py @@ -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, ) @@ -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, ) diff --git a/packages/google-cloud-retail/google/cloud/retail_v2/services/user_event_service/transports/base.py b/packages/google-cloud-retail/google/cloud/retail_v2/services/user_event_service/transports/base.py index 9a9aa85234b7..7d8200909fb1 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2/services/user_event_service/transports/base.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2/services/user_event_service/transports/base.py @@ -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, diff --git a/packages/google-cloud-retail/google/cloud/retail_v2/types/product.py b/packages/google-cloud-retail/google/cloud/retail_v2/types/product.py index dd2a65f39e8e..dc5ddcd5ce59 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2/types/product.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2/types/product.py @@ -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 `__. Schema.org property @@ -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 diff --git a/packages/google-cloud-retail/google/cloud/retail_v2/types/search_service.py b/packages/google-cloud-retail/google/cloud/retail_v2/types/search_service.py index a164cfdfcd6f..f617d4975608 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2/types/search_service.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2/types/search_service.py @@ -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 `__. + case-sensitive. If this field is unrecognizable, an INVALID_ARGUMENT is returned. @@ -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 `__. + case-sensitive. If this field is unrecognizable, an INVALID_ARGUMENT is returned. @@ -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 `__. + 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 `__. + 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] @@ -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.