diff --git a/google/cloud/retail_v2/services/catalog_service/async_client.py b/google/cloud/retail_v2/services/catalog_service/async_client.py index c5831702..613ab13d 100644 --- a/google/cloud/retail_v2/services/catalog_service/async_client.py +++ b/google/cloud/retail_v2/services/catalog_service/async_client.py @@ -1578,7 +1578,7 @@ async def get_operation( # Done; return the response. return response - async def __aenter__(self): + async def __aenter__(self) -> "CatalogServiceAsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/retail_v2/services/completion_service/async_client.py b/google/cloud/retail_v2/services/completion_service/async_client.py index 0472fc4e..ddab5d68 100644 --- a/google/cloud/retail_v2/services/completion_service/async_client.py +++ b/google/cloud/retail_v2/services/completion_service/async_client.py @@ -525,7 +525,7 @@ async def get_operation( # Done; return the response. return response - async def __aenter__(self): + async def __aenter__(self) -> "CompletionServiceAsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/retail_v2/services/control_service/async_client.py b/google/cloud/retail_v2/services/control_service/async_client.py index 7c3b7dd6..9d3fa30a 100644 --- a/google/cloud/retail_v2/services/control_service/async_client.py +++ b/google/cloud/retail_v2/services/control_service/async_client.py @@ -903,7 +903,7 @@ async def get_operation( # Done; return the response. return response - async def __aenter__(self): + async def __aenter__(self) -> "ControlServiceAsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/retail_v2/services/model_service/async_client.py b/google/cloud/retail_v2/services/model_service/async_client.py index 56723f8e..ba3a7af5 100644 --- a/google/cloud/retail_v2/services/model_service/async_client.py +++ b/google/cloud/retail_v2/services/model_service/async_client.py @@ -1246,7 +1246,7 @@ async def get_operation( # Done; return the response. return response - async def __aenter__(self): + async def __aenter__(self) -> "ModelServiceAsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/retail_v2/services/prediction_service/async_client.py b/google/cloud/retail_v2/services/prediction_service/async_client.py index 1bf76d71..42399e96 100644 --- a/google/cloud/retail_v2/services/prediction_service/async_client.py +++ b/google/cloud/retail_v2/services/prediction_service/async_client.py @@ -408,7 +408,7 @@ async def get_operation( # Done; return the response. return response - async def __aenter__(self): + async def __aenter__(self) -> "PredictionServiceAsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/retail_v2/services/product_service/async_client.py b/google/cloud/retail_v2/services/product_service/async_client.py index 5463d303..79693adb 100644 --- a/google/cloud/retail_v2/services/product_service/async_client.py +++ b/google/cloud/retail_v2/services/product_service/async_client.py @@ -1984,7 +1984,7 @@ async def get_operation( # Done; return the response. return response - async def __aenter__(self): + async def __aenter__(self) -> "ProductServiceAsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/retail_v2/services/search_service/async_client.py b/google/cloud/retail_v2/services/search_service/async_client.py index 584aa1b1..219faad8 100644 --- a/google/cloud/retail_v2/services/search_service/async_client.py +++ b/google/cloud/retail_v2/services/search_service/async_client.py @@ -438,7 +438,7 @@ async def get_operation( # Done; return the response. return response - async def __aenter__(self): + async def __aenter__(self) -> "SearchServiceAsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/retail_v2/services/serving_config_service/async_client.py b/google/cloud/retail_v2/services/serving_config_service/async_client.py index a0c0fbf0..ba071bcc 100644 --- a/google/cloud/retail_v2/services/serving_config_service/async_client.py +++ b/google/cloud/retail_v2/services/serving_config_service/async_client.py @@ -1146,7 +1146,7 @@ async def get_operation( # Done; return the response. return response - async def __aenter__(self): + async def __aenter__(self) -> "ServingConfigServiceAsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/retail_v2/services/user_event_service/async_client.py b/google/cloud/retail_v2/services/user_event_service/async_client.py index cf6b6fc5..0cb906a1 100644 --- a/google/cloud/retail_v2/services/user_event_service/async_client.py +++ b/google/cloud/retail_v2/services/user_event_service/async_client.py @@ -894,7 +894,7 @@ async def get_operation( # Done; return the response. return response - async def __aenter__(self): + async def __aenter__(self) -> "UserEventServiceAsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/retail_v2alpha/services/catalog_service/async_client.py b/google/cloud/retail_v2alpha/services/catalog_service/async_client.py index 017c54b4..0dc06a28 100644 --- a/google/cloud/retail_v2alpha/services/catalog_service/async_client.py +++ b/google/cloud/retail_v2alpha/services/catalog_service/async_client.py @@ -1672,7 +1672,7 @@ async def get_operation( # Done; return the response. return response - async def __aenter__(self): + async def __aenter__(self) -> "CatalogServiceAsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/retail_v2alpha/services/completion_service/async_client.py b/google/cloud/retail_v2alpha/services/completion_service/async_client.py index 26204278..1d67bfaf 100644 --- a/google/cloud/retail_v2alpha/services/completion_service/async_client.py +++ b/google/cloud/retail_v2alpha/services/completion_service/async_client.py @@ -525,7 +525,7 @@ async def get_operation( # Done; return the response. return response - async def __aenter__(self): + async def __aenter__(self) -> "CompletionServiceAsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/retail_v2alpha/services/control_service/async_client.py b/google/cloud/retail_v2alpha/services/control_service/async_client.py index 13b5ce6f..12c9371b 100644 --- a/google/cloud/retail_v2alpha/services/control_service/async_client.py +++ b/google/cloud/retail_v2alpha/services/control_service/async_client.py @@ -905,7 +905,7 @@ async def get_operation( # Done; return the response. return response - async def __aenter__(self): + async def __aenter__(self) -> "ControlServiceAsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/retail_v2alpha/services/merchant_center_account_link_service/async_client.py b/google/cloud/retail_v2alpha/services/merchant_center_account_link_service/async_client.py index c0ddbb9d..e314fcc8 100644 --- a/google/cloud/retail_v2alpha/services/merchant_center_account_link_service/async_client.py +++ b/google/cloud/retail_v2alpha/services/merchant_center_account_link_service/async_client.py @@ -728,7 +728,7 @@ async def get_operation( # Done; return the response. return response - async def __aenter__(self): + async def __aenter__(self) -> "MerchantCenterAccountLinkServiceAsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/retail_v2alpha/services/model_service/async_client.py b/google/cloud/retail_v2alpha/services/model_service/async_client.py index bd13f831..e288d08d 100644 --- a/google/cloud/retail_v2alpha/services/model_service/async_client.py +++ b/google/cloud/retail_v2alpha/services/model_service/async_client.py @@ -1254,7 +1254,7 @@ async def get_operation( # Done; return the response. return response - async def __aenter__(self): + async def __aenter__(self) -> "ModelServiceAsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/retail_v2alpha/services/prediction_service/async_client.py b/google/cloud/retail_v2alpha/services/prediction_service/async_client.py index 4b1b40c3..dfb6f295 100644 --- a/google/cloud/retail_v2alpha/services/prediction_service/async_client.py +++ b/google/cloud/retail_v2alpha/services/prediction_service/async_client.py @@ -408,7 +408,7 @@ async def get_operation( # Done; return the response. return response - async def __aenter__(self): + async def __aenter__(self) -> "PredictionServiceAsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/retail_v2alpha/services/product_service/async_client.py b/google/cloud/retail_v2alpha/services/product_service/async_client.py index e04bca5f..260a1cad 100644 --- a/google/cloud/retail_v2alpha/services/product_service/async_client.py +++ b/google/cloud/retail_v2alpha/services/product_service/async_client.py @@ -2103,7 +2103,7 @@ async def get_operation( # Done; return the response. return response - async def __aenter__(self): + async def __aenter__(self) -> "ProductServiceAsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/retail_v2alpha/services/search_service/async_client.py b/google/cloud/retail_v2alpha/services/search_service/async_client.py index 124dcaf6..021c4e09 100644 --- a/google/cloud/retail_v2alpha/services/search_service/async_client.py +++ b/google/cloud/retail_v2alpha/services/search_service/async_client.py @@ -438,7 +438,7 @@ async def get_operation( # Done; return the response. return response - async def __aenter__(self): + async def __aenter__(self) -> "SearchServiceAsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/retail_v2alpha/services/serving_config_service/async_client.py b/google/cloud/retail_v2alpha/services/serving_config_service/async_client.py index 959352fb..3722d3dd 100644 --- a/google/cloud/retail_v2alpha/services/serving_config_service/async_client.py +++ b/google/cloud/retail_v2alpha/services/serving_config_service/async_client.py @@ -1146,7 +1146,7 @@ async def get_operation( # Done; return the response. return response - async def __aenter__(self): + async def __aenter__(self) -> "ServingConfigServiceAsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/retail_v2alpha/services/user_event_service/async_client.py b/google/cloud/retail_v2alpha/services/user_event_service/async_client.py index bd5b3aa9..62180b1f 100644 --- a/google/cloud/retail_v2alpha/services/user_event_service/async_client.py +++ b/google/cloud/retail_v2alpha/services/user_event_service/async_client.py @@ -894,7 +894,7 @@ async def get_operation( # Done; return the response. return response - async def __aenter__(self): + async def __aenter__(self) -> "UserEventServiceAsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/retail_v2beta/services/catalog_service/async_client.py b/google/cloud/retail_v2beta/services/catalog_service/async_client.py index 3a4d155c..be7409fe 100644 --- a/google/cloud/retail_v2beta/services/catalog_service/async_client.py +++ b/google/cloud/retail_v2beta/services/catalog_service/async_client.py @@ -1670,7 +1670,7 @@ async def get_operation( # Done; return the response. return response - async def __aenter__(self): + async def __aenter__(self) -> "CatalogServiceAsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/retail_v2beta/services/completion_service/async_client.py b/google/cloud/retail_v2beta/services/completion_service/async_client.py index 3fc5d4ff..b9b8e600 100644 --- a/google/cloud/retail_v2beta/services/completion_service/async_client.py +++ b/google/cloud/retail_v2beta/services/completion_service/async_client.py @@ -525,7 +525,7 @@ async def get_operation( # Done; return the response. return response - async def __aenter__(self): + async def __aenter__(self) -> "CompletionServiceAsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/retail_v2beta/services/control_service/async_client.py b/google/cloud/retail_v2beta/services/control_service/async_client.py index 8090d940..a4835ffc 100644 --- a/google/cloud/retail_v2beta/services/control_service/async_client.py +++ b/google/cloud/retail_v2beta/services/control_service/async_client.py @@ -905,7 +905,7 @@ async def get_operation( # Done; return the response. return response - async def __aenter__(self): + async def __aenter__(self) -> "ControlServiceAsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/retail_v2beta/services/model_service/async_client.py b/google/cloud/retail_v2beta/services/model_service/async_client.py index 98ff5a88..edc33afb 100644 --- a/google/cloud/retail_v2beta/services/model_service/async_client.py +++ b/google/cloud/retail_v2beta/services/model_service/async_client.py @@ -1248,7 +1248,7 @@ async def get_operation( # Done; return the response. return response - async def __aenter__(self): + async def __aenter__(self) -> "ModelServiceAsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/retail_v2beta/services/prediction_service/async_client.py b/google/cloud/retail_v2beta/services/prediction_service/async_client.py index 7f956a75..6d944ede 100644 --- a/google/cloud/retail_v2beta/services/prediction_service/async_client.py +++ b/google/cloud/retail_v2beta/services/prediction_service/async_client.py @@ -408,7 +408,7 @@ async def get_operation( # Done; return the response. return response - async def __aenter__(self): + async def __aenter__(self) -> "PredictionServiceAsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/retail_v2beta/services/product_service/async_client.py b/google/cloud/retail_v2beta/services/product_service/async_client.py index f7916d29..651b9713 100644 --- a/google/cloud/retail_v2beta/services/product_service/async_client.py +++ b/google/cloud/retail_v2beta/services/product_service/async_client.py @@ -1986,7 +1986,7 @@ async def get_operation( # Done; return the response. return response - async def __aenter__(self): + async def __aenter__(self) -> "ProductServiceAsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/retail_v2beta/services/search_service/async_client.py b/google/cloud/retail_v2beta/services/search_service/async_client.py index 16c4dbd0..0ec29168 100644 --- a/google/cloud/retail_v2beta/services/search_service/async_client.py +++ b/google/cloud/retail_v2beta/services/search_service/async_client.py @@ -438,7 +438,7 @@ async def get_operation( # Done; return the response. return response - async def __aenter__(self): + async def __aenter__(self) -> "SearchServiceAsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/retail_v2beta/services/serving_config_service/async_client.py b/google/cloud/retail_v2beta/services/serving_config_service/async_client.py index 00af57f5..476c9e80 100644 --- a/google/cloud/retail_v2beta/services/serving_config_service/async_client.py +++ b/google/cloud/retail_v2beta/services/serving_config_service/async_client.py @@ -1146,7 +1146,7 @@ async def get_operation( # Done; return the response. return response - async def __aenter__(self): + async def __aenter__(self) -> "ServingConfigServiceAsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/retail_v2beta/services/user_event_service/async_client.py b/google/cloud/retail_v2beta/services/user_event_service/async_client.py index 557c8c52..0caf6aab 100644 --- a/google/cloud/retail_v2beta/services/user_event_service/async_client.py +++ b/google/cloud/retail_v2beta/services/user_event_service/async_client.py @@ -894,7 +894,7 @@ async def get_operation( # Done; return the response. return response - async def __aenter__(self): + async def __aenter__(self) -> "UserEventServiceAsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/samples/generated_samples/snippet_metadata_google.cloud.retail.v2.json b/samples/generated_samples/snippet_metadata_google.cloud.retail.v2.json index afd4e9dc..1a31fd9b 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.retail.v2.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.retail.v2.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-retail", - "version": "1.16.1" + "version": "0.1.0" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_google.cloud.retail.v2alpha.json b/samples/generated_samples/snippet_metadata_google.cloud.retail.v2alpha.json index cb025e72..55845bb0 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.retail.v2alpha.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.retail.v2alpha.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-retail", - "version": "1.16.1" + "version": "0.1.0" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_google.cloud.retail.v2beta.json b/samples/generated_samples/snippet_metadata_google.cloud.retail.v2beta.json index b97745d4..edada0c1 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.retail.v2beta.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.retail.v2beta.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-retail", - "version": "1.16.1" + "version": "0.1.0" }, "snippets": [ { diff --git a/tests/unit/gapic/retail_v2/test_catalog_service.py b/tests/unit/gapic/retail_v2/test_catalog_service.py index 8c37eeee..114ebebb 100644 --- a/tests/unit/gapic/retail_v2/test_catalog_service.py +++ b/tests/unit/gapic/retail_v2/test_catalog_service.py @@ -1121,9 +1121,11 @@ async def test_list_catalogs_async_pages(): RuntimeError, ) pages = [] - async for page_ in ( + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch await client.list_catalogs(request={}) - ).pages: # pragma: no branch + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token diff --git a/tests/unit/gapic/retail_v2/test_control_service.py b/tests/unit/gapic/retail_v2/test_control_service.py index 7dc68842..1aed8497 100644 --- a/tests/unit/gapic/retail_v2/test_control_service.py +++ b/tests/unit/gapic/retail_v2/test_control_service.py @@ -737,7 +737,6 @@ def test_create_control(request_type, transport: str = "grpc"): search_solution_use_case=[ common.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH ], - rule=common.Rule(boost_action=common.Rule.BoostAction(boost=0.551)), ) response = client.create_control(request) @@ -1246,7 +1245,6 @@ def test_update_control(request_type, transport: str = "grpc"): search_solution_use_case=[ common.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH ], - rule=common.Rule(boost_action=common.Rule.BoostAction(boost=0.551)), ) response = client.update_control(request) @@ -1525,7 +1523,6 @@ def test_get_control(request_type, transport: str = "grpc"): search_solution_use_case=[ common.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH ], - rule=common.Rule(boost_action=common.Rule.BoostAction(boost=0.551)), ) response = client.get_control(request) @@ -2166,9 +2163,11 @@ async def test_list_controls_async_pages(): RuntimeError, ) pages = [] - async for page_ in ( + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch await client.list_controls(request={}) - ).pages: # pragma: no branch + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2250,7 +2249,6 @@ def test_create_control_rest(request_type): search_solution_use_case=[ common.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH ], - rule=common.Rule(boost_action=common.Rule.BoostAction(boost=0.551)), ) # Wrap the value into a proper Response obj @@ -2925,7 +2923,6 @@ def test_update_control_rest(request_type): search_solution_use_case=[ common.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH ], - rule=common.Rule(boost_action=common.Rule.BoostAction(boost=0.551)), ) # Wrap the value into a proper Response obj @@ -3268,7 +3265,6 @@ def test_get_control_rest(request_type): search_solution_use_case=[ common.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH ], - rule=common.Rule(boost_action=common.Rule.BoostAction(boost=0.551)), ) # Wrap the value into a proper Response obj diff --git a/tests/unit/gapic/retail_v2/test_model_service.py b/tests/unit/gapic/retail_v2/test_model_service.py index 7d4fcac9..750caf20 100644 --- a/tests/unit/gapic/retail_v2/test_model_service.py +++ b/tests/unit/gapic/retail_v2/test_model_service.py @@ -2401,9 +2401,11 @@ async def test_list_models_async_pages(): RuntimeError, ) pages = [] - async for page_ in ( + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch await client.list_models(request={}) - ).pages: # pragma: no branch + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token diff --git a/tests/unit/gapic/retail_v2/test_product_service.py b/tests/unit/gapic/retail_v2/test_product_service.py index dc1a97dd..565d4f08 100644 --- a/tests/unit/gapic/retail_v2/test_product_service.py +++ b/tests/unit/gapic/retail_v2/test_product_service.py @@ -760,7 +760,6 @@ def test_create_product(request_type, transport: str = "grpc"): materials=["materials_value"], patterns=["patterns_value"], conditions=["conditions_value"], - expire_time=timestamp_pb2.Timestamp(seconds=751), ) response = client.create_product(request) @@ -1085,7 +1084,6 @@ def test_get_product(request_type, transport: str = "grpc"): materials=["materials_value"], patterns=["patterns_value"], conditions=["conditions_value"], - expire_time=timestamp_pb2.Timestamp(seconds=751), ) response = client.get_product(request) @@ -1755,9 +1753,11 @@ async def test_list_products_async_pages(): RuntimeError, ) pages = [] - async for page_ in ( + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch await client.list_products(request={}) - ).pages: # pragma: no branch + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -1802,7 +1802,6 @@ def test_update_product(request_type, transport: str = "grpc"): materials=["materials_value"], patterns=["patterns_value"], conditions=["conditions_value"], - expire_time=timestamp_pb2.Timestamp(seconds=751), ) response = client.update_product(request) @@ -3763,7 +3762,6 @@ def test_create_product_rest(request_type): materials=["materials_value"], patterns=["patterns_value"], conditions=["conditions_value"], - expire_time=timestamp_pb2.Timestamp(seconds=751), ) # Wrap the value into a proper Response obj @@ -4183,7 +4181,6 @@ def test_get_product_rest(request_type): materials=["materials_value"], patterns=["patterns_value"], conditions=["conditions_value"], - expire_time=timestamp_pb2.Timestamp(seconds=751), ) # Wrap the value into a proper Response obj @@ -4924,7 +4921,6 @@ def test_update_product_rest(request_type): materials=["materials_value"], patterns=["patterns_value"], conditions=["conditions_value"], - expire_time=timestamp_pb2.Timestamp(seconds=751), ) # Wrap the value into a proper Response obj diff --git a/tests/unit/gapic/retail_v2/test_search_service.py b/tests/unit/gapic/retail_v2/test_search_service.py index 5d20502a..cf290480 100644 --- a/tests/unit/gapic/retail_v2/test_search_service.py +++ b/tests/unit/gapic/retail_v2/test_search_service.py @@ -1058,6 +1058,8 @@ async def test_search_async_pages(): RuntimeError, ) pages = [] + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 async for page_ in (await client.search(request={})).pages: # pragma: no branch pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): diff --git a/tests/unit/gapic/retail_v2/test_serving_config_service.py b/tests/unit/gapic/retail_v2/test_serving_config_service.py index aededf03..68cf13de 100644 --- a/tests/unit/gapic/retail_v2/test_serving_config_service.py +++ b/tests/unit/gapic/retail_v2/test_serving_config_service.py @@ -2417,9 +2417,11 @@ async def test_list_serving_configs_async_pages(): RuntimeError, ) pages = [] - async for page_ in ( + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch await client.list_serving_configs(request={}) - ).pages: # pragma: no branch + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token diff --git a/tests/unit/gapic/retail_v2alpha/test_catalog_service.py b/tests/unit/gapic/retail_v2alpha/test_catalog_service.py index d501dd95..a05244f8 100644 --- a/tests/unit/gapic/retail_v2alpha/test_catalog_service.py +++ b/tests/unit/gapic/retail_v2alpha/test_catalog_service.py @@ -1121,9 +1121,11 @@ async def test_list_catalogs_async_pages(): RuntimeError, ) pages = [] - async for page_ in ( + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch await client.list_catalogs(request={}) - ).pages: # pragma: no branch + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token diff --git a/tests/unit/gapic/retail_v2alpha/test_control_service.py b/tests/unit/gapic/retail_v2alpha/test_control_service.py index 37b36d1e..fcfb31b8 100644 --- a/tests/unit/gapic/retail_v2alpha/test_control_service.py +++ b/tests/unit/gapic/retail_v2alpha/test_control_service.py @@ -737,11 +737,6 @@ def test_create_control(request_type, transport: str = "grpc"): search_solution_use_case=[ common.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH ], - facet_spec=search_service.SearchRequest.FacetSpec( - facet_key=search_service.SearchRequest.FacetSpec.FacetKey( - key="key_value" - ) - ), ) response = client.create_control(request) @@ -1274,11 +1269,6 @@ def test_update_control(request_type, transport: str = "grpc"): search_solution_use_case=[ common.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH ], - facet_spec=search_service.SearchRequest.FacetSpec( - facet_key=search_service.SearchRequest.FacetSpec.FacetKey( - key="key_value" - ) - ), ) response = client.update_control(request) @@ -1581,11 +1571,6 @@ def test_get_control(request_type, transport: str = "grpc"): search_solution_use_case=[ common.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH ], - facet_spec=search_service.SearchRequest.FacetSpec( - facet_key=search_service.SearchRequest.FacetSpec.FacetKey( - key="key_value" - ) - ), ) response = client.get_control(request) @@ -2226,9 +2211,11 @@ async def test_list_controls_async_pages(): RuntimeError, ) pages = [] - async for page_ in ( + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch await client.list_controls(request={}) - ).pages: # pragma: no branch + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2339,11 +2326,6 @@ def test_create_control_rest(request_type): search_solution_use_case=[ common.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH ], - facet_spec=search_service.SearchRequest.FacetSpec( - facet_key=search_service.SearchRequest.FacetSpec.FacetKey( - key="key_value" - ) - ), ) # Wrap the value into a proper Response obj @@ -3084,11 +3066,6 @@ def test_update_control_rest(request_type): search_solution_use_case=[ common.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH ], - facet_spec=search_service.SearchRequest.FacetSpec( - facet_key=search_service.SearchRequest.FacetSpec.FacetKey( - key="key_value" - ) - ), ) # Wrap the value into a proper Response obj @@ -3468,11 +3445,6 @@ def test_get_control_rest(request_type): search_solution_use_case=[ common.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH ], - facet_spec=search_service.SearchRequest.FacetSpec( - facet_key=search_service.SearchRequest.FacetSpec.FacetKey( - key="key_value" - ) - ), ) # Wrap the value into a proper Response obj diff --git a/tests/unit/gapic/retail_v2alpha/test_model_service.py b/tests/unit/gapic/retail_v2alpha/test_model_service.py index f5b5116e..62ce0bae 100644 --- a/tests/unit/gapic/retail_v2alpha/test_model_service.py +++ b/tests/unit/gapic/retail_v2alpha/test_model_service.py @@ -996,9 +996,6 @@ def test_get_model(request_type, transport: str = "grpc"): tuning_operation="tuning_operation_value", data_state=model.Model.DataState.DATA_OK, filtering_option=common.RecommendationsFilteringOption.RECOMMENDATIONS_FILTERING_DISABLED, - page_optimization_config=model.Model.PageOptimizationConfig( - page_optimization_event_type="page_optimization_event_type_value" - ), ) response = client.get_model(request) @@ -1275,9 +1272,6 @@ def test_pause_model(request_type, transport: str = "grpc"): tuning_operation="tuning_operation_value", data_state=model.Model.DataState.DATA_OK, filtering_option=common.RecommendationsFilteringOption.RECOMMENDATIONS_FILTERING_DISABLED, - page_optimization_config=model.Model.PageOptimizationConfig( - page_optimization_event_type="page_optimization_event_type_value" - ), ) response = client.pause_model(request) @@ -1554,9 +1548,6 @@ def test_resume_model(request_type, transport: str = "grpc"): tuning_operation="tuning_operation_value", data_state=model.Model.DataState.DATA_OK, filtering_option=common.RecommendationsFilteringOption.RECOMMENDATIONS_FILTERING_DISABLED, - page_optimization_config=model.Model.PageOptimizationConfig( - page_optimization_event_type="page_optimization_event_type_value" - ), ) response = client.resume_model(request) @@ -2434,9 +2425,11 @@ async def test_list_models_async_pages(): RuntimeError, ) pages = [] - async for page_ in ( + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch await client.list_models(request={}) - ).pages: # pragma: no branch + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2473,9 +2466,6 @@ def test_update_model(request_type, transport: str = "grpc"): tuning_operation="tuning_operation_value", data_state=gcr_model.Model.DataState.DATA_OK, filtering_option=common.RecommendationsFilteringOption.RECOMMENDATIONS_FILTERING_DISABLED, - page_optimization_config=gcr_model.Model.PageOptimizationConfig( - page_optimization_event_type="page_optimization_event_type_value" - ), ) response = client.update_model(request) @@ -3368,9 +3358,6 @@ def test_get_model_rest(request_type): tuning_operation="tuning_operation_value", data_state=model.Model.DataState.DATA_OK, filtering_option=common.RecommendationsFilteringOption.RECOMMENDATIONS_FILTERING_DISABLED, - page_optimization_config=model.Model.PageOptimizationConfig( - page_optimization_event_type="page_optimization_event_type_value" - ), ) # Wrap the value into a proper Response obj @@ -3663,9 +3650,6 @@ def test_pause_model_rest(request_type): tuning_operation="tuning_operation_value", data_state=model.Model.DataState.DATA_OK, filtering_option=common.RecommendationsFilteringOption.RECOMMENDATIONS_FILTERING_DISABLED, - page_optimization_config=model.Model.PageOptimizationConfig( - page_optimization_event_type="page_optimization_event_type_value" - ), ) # Wrap the value into a proper Response obj @@ -3961,9 +3945,6 @@ def test_resume_model_rest(request_type): tuning_operation="tuning_operation_value", data_state=model.Model.DataState.DATA_OK, filtering_option=common.RecommendationsFilteringOption.RECOMMENDATIONS_FILTERING_DISABLED, - page_optimization_config=model.Model.PageOptimizationConfig( - page_optimization_event_type="page_optimization_event_type_value" - ), ) # Wrap the value into a proper Response obj @@ -4896,9 +4877,6 @@ def test_update_model_rest(request_type): tuning_operation="tuning_operation_value", data_state=gcr_model.Model.DataState.DATA_OK, filtering_option=common.RecommendationsFilteringOption.RECOMMENDATIONS_FILTERING_DISABLED, - page_optimization_config=gcr_model.Model.PageOptimizationConfig( - page_optimization_event_type="page_optimization_event_type_value" - ), ) # Wrap the value into a proper Response obj diff --git a/tests/unit/gapic/retail_v2alpha/test_product_service.py b/tests/unit/gapic/retail_v2alpha/test_product_service.py index 6cb69881..af91b5cf 100644 --- a/tests/unit/gapic/retail_v2alpha/test_product_service.py +++ b/tests/unit/gapic/retail_v2alpha/test_product_service.py @@ -760,7 +760,6 @@ def test_create_product(request_type, transport: str = "grpc"): materials=["materials_value"], patterns=["patterns_value"], conditions=["conditions_value"], - expire_time=timestamp_pb2.Timestamp(seconds=751), ) response = client.create_product(request) @@ -1085,7 +1084,6 @@ def test_get_product(request_type, transport: str = "grpc"): materials=["materials_value"], patterns=["patterns_value"], conditions=["conditions_value"], - expire_time=timestamp_pb2.Timestamp(seconds=751), ) response = client.get_product(request) @@ -1759,9 +1757,11 @@ async def test_list_products_async_pages(): RuntimeError, ) pages = [] - async for page_ in ( + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch await client.list_products(request={}) - ).pages: # pragma: no branch + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -1806,7 +1806,6 @@ def test_update_product(request_type, transport: str = "grpc"): materials=["materials_value"], patterns=["patterns_value"], conditions=["conditions_value"], - expire_time=timestamp_pb2.Timestamp(seconds=751), ) response = client.update_product(request) @@ -3911,7 +3910,6 @@ def test_create_product_rest(request_type): materials=["materials_value"], patterns=["patterns_value"], conditions=["conditions_value"], - expire_time=timestamp_pb2.Timestamp(seconds=751), ) # Wrap the value into a proper Response obj @@ -4331,7 +4329,6 @@ def test_get_product_rest(request_type): materials=["materials_value"], patterns=["patterns_value"], conditions=["conditions_value"], - expire_time=timestamp_pb2.Timestamp(seconds=751), ) # Wrap the value into a proper Response obj @@ -5076,7 +5073,6 @@ def test_update_product_rest(request_type): materials=["materials_value"], patterns=["patterns_value"], conditions=["conditions_value"], - expire_time=timestamp_pb2.Timestamp(seconds=751), ) # Wrap the value into a proper Response obj diff --git a/tests/unit/gapic/retail_v2alpha/test_search_service.py b/tests/unit/gapic/retail_v2alpha/test_search_service.py index 2bf28122..ee29b7f8 100644 --- a/tests/unit/gapic/retail_v2alpha/test_search_service.py +++ b/tests/unit/gapic/retail_v2alpha/test_search_service.py @@ -1058,6 +1058,8 @@ async def test_search_async_pages(): RuntimeError, ) pages = [] + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 async for page_ in (await client.search(request={})).pages: # pragma: no branch pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): diff --git a/tests/unit/gapic/retail_v2alpha/test_serving_config_service.py b/tests/unit/gapic/retail_v2alpha/test_serving_config_service.py index d3e4abee..3b94ceac 100644 --- a/tests/unit/gapic/retail_v2alpha/test_serving_config_service.py +++ b/tests/unit/gapic/retail_v2alpha/test_serving_config_service.py @@ -2417,9 +2417,11 @@ async def test_list_serving_configs_async_pages(): RuntimeError, ) pages = [] - async for page_ in ( + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch await client.list_serving_configs(request={}) - ).pages: # pragma: no branch + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token diff --git a/tests/unit/gapic/retail_v2beta/test_catalog_service.py b/tests/unit/gapic/retail_v2beta/test_catalog_service.py index 0181824c..aadc54f5 100644 --- a/tests/unit/gapic/retail_v2beta/test_catalog_service.py +++ b/tests/unit/gapic/retail_v2beta/test_catalog_service.py @@ -1121,9 +1121,11 @@ async def test_list_catalogs_async_pages(): RuntimeError, ) pages = [] - async for page_ in ( + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch await client.list_catalogs(request={}) - ).pages: # pragma: no branch + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token diff --git a/tests/unit/gapic/retail_v2beta/test_control_service.py b/tests/unit/gapic/retail_v2beta/test_control_service.py index 8fc6943b..67b38942 100644 --- a/tests/unit/gapic/retail_v2beta/test_control_service.py +++ b/tests/unit/gapic/retail_v2beta/test_control_service.py @@ -737,11 +737,6 @@ def test_create_control(request_type, transport: str = "grpc"): search_solution_use_case=[ common.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH ], - facet_spec=search_service.SearchRequest.FacetSpec( - facet_key=search_service.SearchRequest.FacetSpec.FacetKey( - key="key_value" - ) - ), ) response = client.create_control(request) @@ -1274,11 +1269,6 @@ def test_update_control(request_type, transport: str = "grpc"): search_solution_use_case=[ common.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH ], - facet_spec=search_service.SearchRequest.FacetSpec( - facet_key=search_service.SearchRequest.FacetSpec.FacetKey( - key="key_value" - ) - ), ) response = client.update_control(request) @@ -1581,11 +1571,6 @@ def test_get_control(request_type, transport: str = "grpc"): search_solution_use_case=[ common.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH ], - facet_spec=search_service.SearchRequest.FacetSpec( - facet_key=search_service.SearchRequest.FacetSpec.FacetKey( - key="key_value" - ) - ), ) response = client.get_control(request) @@ -2226,9 +2211,11 @@ async def test_list_controls_async_pages(): RuntimeError, ) pages = [] - async for page_ in ( + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch await client.list_controls(request={}) - ).pages: # pragma: no branch + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2339,11 +2326,6 @@ def test_create_control_rest(request_type): search_solution_use_case=[ common.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH ], - facet_spec=search_service.SearchRequest.FacetSpec( - facet_key=search_service.SearchRequest.FacetSpec.FacetKey( - key="key_value" - ) - ), ) # Wrap the value into a proper Response obj @@ -3084,11 +3066,6 @@ def test_update_control_rest(request_type): search_solution_use_case=[ common.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH ], - facet_spec=search_service.SearchRequest.FacetSpec( - facet_key=search_service.SearchRequest.FacetSpec.FacetKey( - key="key_value" - ) - ), ) # Wrap the value into a proper Response obj @@ -3468,11 +3445,6 @@ def test_get_control_rest(request_type): search_solution_use_case=[ common.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH ], - facet_spec=search_service.SearchRequest.FacetSpec( - facet_key=search_service.SearchRequest.FacetSpec.FacetKey( - key="key_value" - ) - ), ) # Wrap the value into a proper Response obj diff --git a/tests/unit/gapic/retail_v2beta/test_model_service.py b/tests/unit/gapic/retail_v2beta/test_model_service.py index 24b0e943..cd4e697f 100644 --- a/tests/unit/gapic/retail_v2beta/test_model_service.py +++ b/tests/unit/gapic/retail_v2beta/test_model_service.py @@ -2401,9 +2401,11 @@ async def test_list_models_async_pages(): RuntimeError, ) pages = [] - async for page_ in ( + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch await client.list_models(request={}) - ).pages: # pragma: no branch + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token diff --git a/tests/unit/gapic/retail_v2beta/test_product_service.py b/tests/unit/gapic/retail_v2beta/test_product_service.py index 3897d0c9..8ba2bd5b 100644 --- a/tests/unit/gapic/retail_v2beta/test_product_service.py +++ b/tests/unit/gapic/retail_v2beta/test_product_service.py @@ -760,7 +760,6 @@ def test_create_product(request_type, transport: str = "grpc"): materials=["materials_value"], patterns=["patterns_value"], conditions=["conditions_value"], - expire_time=timestamp_pb2.Timestamp(seconds=751), ) response = client.create_product(request) @@ -1085,7 +1084,6 @@ def test_get_product(request_type, transport: str = "grpc"): materials=["materials_value"], patterns=["patterns_value"], conditions=["conditions_value"], - expire_time=timestamp_pb2.Timestamp(seconds=751), ) response = client.get_product(request) @@ -1755,9 +1753,11 @@ async def test_list_products_async_pages(): RuntimeError, ) pages = [] - async for page_ in ( + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch await client.list_products(request={}) - ).pages: # pragma: no branch + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -1802,7 +1802,6 @@ def test_update_product(request_type, transport: str = "grpc"): materials=["materials_value"], patterns=["patterns_value"], conditions=["conditions_value"], - expire_time=timestamp_pb2.Timestamp(seconds=751), ) response = client.update_product(request) @@ -3763,7 +3762,6 @@ def test_create_product_rest(request_type): materials=["materials_value"], patterns=["patterns_value"], conditions=["conditions_value"], - expire_time=timestamp_pb2.Timestamp(seconds=751), ) # Wrap the value into a proper Response obj @@ -4183,7 +4181,6 @@ def test_get_product_rest(request_type): materials=["materials_value"], patterns=["patterns_value"], conditions=["conditions_value"], - expire_time=timestamp_pb2.Timestamp(seconds=751), ) # Wrap the value into a proper Response obj @@ -4924,7 +4921,6 @@ def test_update_product_rest(request_type): materials=["materials_value"], patterns=["patterns_value"], conditions=["conditions_value"], - expire_time=timestamp_pb2.Timestamp(seconds=751), ) # Wrap the value into a proper Response obj diff --git a/tests/unit/gapic/retail_v2beta/test_search_service.py b/tests/unit/gapic/retail_v2beta/test_search_service.py index 057fd4bb..eebb14d4 100644 --- a/tests/unit/gapic/retail_v2beta/test_search_service.py +++ b/tests/unit/gapic/retail_v2beta/test_search_service.py @@ -1058,6 +1058,8 @@ async def test_search_async_pages(): RuntimeError, ) pages = [] + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 async for page_ in (await client.search(request={})).pages: # pragma: no branch pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): diff --git a/tests/unit/gapic/retail_v2beta/test_serving_config_service.py b/tests/unit/gapic/retail_v2beta/test_serving_config_service.py index 57f82c0b..dd9d27cf 100644 --- a/tests/unit/gapic/retail_v2beta/test_serving_config_service.py +++ b/tests/unit/gapic/retail_v2beta/test_serving_config_service.py @@ -2417,9 +2417,11 @@ async def test_list_serving_configs_async_pages(): RuntimeError, ) pages = [] - async for page_ in ( + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch await client.list_serving_configs(request={}) - ).pages: # pragma: no branch + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token