diff --git a/.kokoro/continuous/continuous.cfg b/.kokoro/continuous/continuous.cfg index 18a4c35325..8f43917d92 100644 --- a/.kokoro/continuous/continuous.cfg +++ b/.kokoro/continuous/continuous.cfg @@ -1 +1 @@ -# Format: //devtools/kokoro/config/proto/build.proto +# Format: //devtools/kokoro/config/proto/build.proto \ No newline at end of file diff --git a/google/cloud/aiplatform_v1/services/dataset_service/async_client.py b/google/cloud/aiplatform_v1/services/dataset_service/async_client.py index 5c2f33f953..b9b5648676 100644 --- a/google/cloud/aiplatform_v1/services/dataset_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/dataset_service/async_client.py @@ -241,9 +241,9 @@ async def create_dataset( from google.cloud import aiplatform_v1 - def sample_create_dataset(): + async def sample_create_dataset(): # Create a client - client = aiplatform_v1.DatasetServiceClient() + client = aiplatform_v1.DatasetServiceAsyncClient() # Initialize request argument(s) dataset = aiplatform_v1.Dataset() @@ -261,7 +261,7 @@ def sample_create_dataset(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -365,9 +365,9 @@ async def get_dataset( from google.cloud import aiplatform_v1 - def sample_get_dataset(): + async def sample_get_dataset(): # Create a client - client = aiplatform_v1.DatasetServiceClient() + client = aiplatform_v1.DatasetServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.GetDatasetRequest( @@ -375,7 +375,7 @@ def sample_get_dataset(): ) # Make the request - response = client.get_dataset(request=request) + response = await client.get_dataset(request=request) # Handle the response print(response) @@ -461,9 +461,9 @@ async def update_dataset( from google.cloud import aiplatform_v1 - def sample_update_dataset(): + async def sample_update_dataset(): # Create a client - client = aiplatform_v1.DatasetServiceClient() + client = aiplatform_v1.DatasetServiceAsyncClient() # Initialize request argument(s) dataset = aiplatform_v1.Dataset() @@ -476,7 +476,7 @@ def sample_update_dataset(): ) # Make the request - response = client.update_dataset(request=request) + response = await client.update_dataset(request=request) # Handle the response print(response) @@ -578,9 +578,9 @@ async def list_datasets( from google.cloud import aiplatform_v1 - def sample_list_datasets(): + async def sample_list_datasets(): # Create a client - client = aiplatform_v1.DatasetServiceClient() + client = aiplatform_v1.DatasetServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ListDatasetsRequest( @@ -591,7 +591,7 @@ def sample_list_datasets(): page_result = client.list_datasets(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -686,9 +686,9 @@ async def delete_dataset( from google.cloud import aiplatform_v1 - def sample_delete_dataset(): + async def sample_delete_dataset(): # Create a client - client = aiplatform_v1.DatasetServiceClient() + client = aiplatform_v1.DatasetServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.DeleteDatasetRequest( @@ -700,7 +700,7 @@ def sample_delete_dataset(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -808,9 +808,9 @@ async def import_data( from google.cloud import aiplatform_v1 - def sample_import_data(): + async def sample_import_data(): # Create a client - client = aiplatform_v1.DatasetServiceClient() + client = aiplatform_v1.DatasetServiceAsyncClient() # Initialize request argument(s) import_configs = aiplatform_v1.ImportDataConfig() @@ -827,7 +827,7 @@ def sample_import_data(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -935,9 +935,9 @@ async def export_data( from google.cloud import aiplatform_v1 - def sample_export_data(): + async def sample_export_data(): # Create a client - client = aiplatform_v1.DatasetServiceClient() + client = aiplatform_v1.DatasetServiceAsyncClient() # Initialize request argument(s) export_config = aiplatform_v1.ExportDataConfig() @@ -953,7 +953,7 @@ def sample_export_data(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1059,9 +1059,9 @@ async def list_data_items( from google.cloud import aiplatform_v1 - def sample_list_data_items(): + async def sample_list_data_items(): # Create a client - client = aiplatform_v1.DatasetServiceClient() + client = aiplatform_v1.DatasetServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ListDataItemsRequest( @@ -1072,7 +1072,7 @@ def sample_list_data_items(): page_result = client.list_data_items(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1168,9 +1168,9 @@ async def get_annotation_spec( from google.cloud import aiplatform_v1 - def sample_get_annotation_spec(): + async def sample_get_annotation_spec(): # Create a client - client = aiplatform_v1.DatasetServiceClient() + client = aiplatform_v1.DatasetServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.GetAnnotationSpecRequest( @@ -1178,7 +1178,7 @@ def sample_get_annotation_spec(): ) # Make the request - response = client.get_annotation_spec(request=request) + response = await client.get_annotation_spec(request=request) # Handle the response print(response) @@ -1264,9 +1264,9 @@ async def list_annotations( from google.cloud import aiplatform_v1 - def sample_list_annotations(): + async def sample_list_annotations(): # Create a client - client = aiplatform_v1.DatasetServiceClient() + client = aiplatform_v1.DatasetServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ListAnnotationsRequest( @@ -1277,7 +1277,7 @@ def sample_list_annotations(): page_result = client.list_annotations(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: diff --git a/google/cloud/aiplatform_v1/services/endpoint_service/async_client.py b/google/cloud/aiplatform_v1/services/endpoint_service/async_client.py index ac4a38c634..dcc5f821d2 100644 --- a/google/cloud/aiplatform_v1/services/endpoint_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/endpoint_service/async_client.py @@ -238,9 +238,9 @@ async def create_endpoint( from google.cloud import aiplatform_v1 - def sample_create_endpoint(): + async def sample_create_endpoint(): # Create a client - client = aiplatform_v1.EndpointServiceClient() + client = aiplatform_v1.EndpointServiceAsyncClient() # Initialize request argument(s) endpoint = aiplatform_v1.Endpoint() @@ -256,7 +256,7 @@ def sample_create_endpoint(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -376,9 +376,9 @@ async def get_endpoint( from google.cloud import aiplatform_v1 - def sample_get_endpoint(): + async def sample_get_endpoint(): # Create a client - client = aiplatform_v1.EndpointServiceClient() + client = aiplatform_v1.EndpointServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.GetEndpointRequest( @@ -386,7 +386,7 @@ def sample_get_endpoint(): ) # Make the request - response = client.get_endpoint(request=request) + response = await client.get_endpoint(request=request) # Handle the response print(response) @@ -472,9 +472,9 @@ async def list_endpoints( from google.cloud import aiplatform_v1 - def sample_list_endpoints(): + async def sample_list_endpoints(): # Create a client - client = aiplatform_v1.EndpointServiceClient() + client = aiplatform_v1.EndpointServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ListEndpointsRequest( @@ -485,7 +485,7 @@ def sample_list_endpoints(): page_result = client.list_endpoints(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -582,9 +582,9 @@ async def update_endpoint( from google.cloud import aiplatform_v1 - def sample_update_endpoint(): + async def sample_update_endpoint(): # Create a client - client = aiplatform_v1.EndpointServiceClient() + client = aiplatform_v1.EndpointServiceAsyncClient() # Initialize request argument(s) endpoint = aiplatform_v1.Endpoint() @@ -595,7 +595,7 @@ def sample_update_endpoint(): ) # Make the request - response = client.update_endpoint(request=request) + response = await client.update_endpoint(request=request) # Handle the response print(response) @@ -692,9 +692,9 @@ async def delete_endpoint( from google.cloud import aiplatform_v1 - def sample_delete_endpoint(): + async def sample_delete_endpoint(): # Create a client - client = aiplatform_v1.EndpointServiceClient() + client = aiplatform_v1.EndpointServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.DeleteEndpointRequest( @@ -706,7 +706,7 @@ def sample_delete_endpoint(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -816,9 +816,9 @@ async def deploy_model( from google.cloud import aiplatform_v1 - def sample_deploy_model(): + async def sample_deploy_model(): # Create a client - client = aiplatform_v1.EndpointServiceClient() + client = aiplatform_v1.EndpointServiceAsyncClient() # Initialize request argument(s) deployed_model = aiplatform_v1.DeployedModel() @@ -835,7 +835,7 @@ def sample_deploy_model(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -973,9 +973,9 @@ async def undeploy_model( from google.cloud import aiplatform_v1 - def sample_undeploy_model(): + async def sample_undeploy_model(): # Create a client - client = aiplatform_v1.EndpointServiceClient() + client = aiplatform_v1.EndpointServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.UndeployModelRequest( @@ -988,7 +988,7 @@ def sample_undeploy_model(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) diff --git a/google/cloud/aiplatform_v1/services/featurestore_online_serving_service/async_client.py b/google/cloud/aiplatform_v1/services/featurestore_online_serving_service/async_client.py index e9e02cba66..5aef4b76de 100644 --- a/google/cloud/aiplatform_v1/services/featurestore_online_serving_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/featurestore_online_serving_service/async_client.py @@ -249,9 +249,9 @@ async def read_feature_values( from google.cloud import aiplatform_v1 - def sample_read_feature_values(): + async def sample_read_feature_values(): # Create a client - client = aiplatform_v1.FeaturestoreOnlineServingServiceClient() + client = aiplatform_v1.FeaturestoreOnlineServingServiceAsyncClient() # Initialize request argument(s) feature_selector = aiplatform_v1.FeatureSelector() @@ -264,7 +264,7 @@ def sample_read_feature_values(): ) # Make the request - response = client.read_feature_values(request=request) + response = await client.read_feature_values(request=request) # Handle the response print(response) @@ -361,9 +361,9 @@ def streaming_read_feature_values( from google.cloud import aiplatform_v1 - def sample_streaming_read_feature_values(): + async def sample_streaming_read_feature_values(): # Create a client - client = aiplatform_v1.FeaturestoreOnlineServingServiceClient() + client = aiplatform_v1.FeaturestoreOnlineServingServiceAsyncClient() # Initialize request argument(s) feature_selector = aiplatform_v1.FeatureSelector() @@ -376,10 +376,10 @@ def sample_streaming_read_feature_values(): ) # Make the request - stream = client.streaming_read_feature_values(request=request) + stream = await client.streaming_read_feature_values(request=request) # Handle the response - for response in stream: + async for response in stream: print(response) Args: diff --git a/google/cloud/aiplatform_v1/services/featurestore_service/async_client.py b/google/cloud/aiplatform_v1/services/featurestore_service/async_client.py index 11c03dea48..29fdf7175c 100644 --- a/google/cloud/aiplatform_v1/services/featurestore_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/featurestore_service/async_client.py @@ -245,9 +245,9 @@ async def create_featurestore( from google.cloud import aiplatform_v1 - def sample_create_featurestore(): + async def sample_create_featurestore(): # Create a client - client = aiplatform_v1.FeaturestoreServiceClient() + client = aiplatform_v1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.CreateFeaturestoreRequest( @@ -260,7 +260,7 @@ def sample_create_featurestore(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -382,9 +382,9 @@ async def get_featurestore( from google.cloud import aiplatform_v1 - def sample_get_featurestore(): + async def sample_get_featurestore(): # Create a client - client = aiplatform_v1.FeaturestoreServiceClient() + client = aiplatform_v1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.GetFeaturestoreRequest( @@ -392,7 +392,7 @@ def sample_get_featurestore(): ) # Make the request - response = client.get_featurestore(request=request) + response = await client.get_featurestore(request=request) # Handle the response print(response) @@ -480,9 +480,9 @@ async def list_featurestores( from google.cloud import aiplatform_v1 - def sample_list_featurestores(): + async def sample_list_featurestores(): # Create a client - client = aiplatform_v1.FeaturestoreServiceClient() + client = aiplatform_v1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ListFeaturestoresRequest( @@ -493,7 +493,7 @@ def sample_list_featurestores(): page_result = client.list_featurestores(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -590,9 +590,9 @@ async def update_featurestore( from google.cloud import aiplatform_v1 - def sample_update_featurestore(): + async def sample_update_featurestore(): # Create a client - client = aiplatform_v1.FeaturestoreServiceClient() + client = aiplatform_v1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.UpdateFeaturestoreRequest( @@ -603,7 +603,7 @@ def sample_update_featurestore(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -726,9 +726,9 @@ async def delete_featurestore( from google.cloud import aiplatform_v1 - def sample_delete_featurestore(): + async def sample_delete_featurestore(): # Create a client - client = aiplatform_v1.FeaturestoreServiceClient() + client = aiplatform_v1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.DeleteFeaturestoreRequest( @@ -740,7 +740,7 @@ def sample_delete_featurestore(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -861,9 +861,9 @@ async def create_entity_type( from google.cloud import aiplatform_v1 - def sample_create_entity_type(): + async def sample_create_entity_type(): # Create a client - client = aiplatform_v1.FeaturestoreServiceClient() + client = aiplatform_v1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.CreateEntityTypeRequest( @@ -876,7 +876,7 @@ def sample_create_entity_type(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -997,9 +997,9 @@ async def get_entity_type( from google.cloud import aiplatform_v1 - def sample_get_entity_type(): + async def sample_get_entity_type(): # Create a client - client = aiplatform_v1.FeaturestoreServiceClient() + client = aiplatform_v1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.GetEntityTypeRequest( @@ -1007,7 +1007,7 @@ def sample_get_entity_type(): ) # Make the request - response = client.get_entity_type(request=request) + response = await client.get_entity_type(request=request) # Handle the response print(response) @@ -1096,9 +1096,9 @@ async def list_entity_types( from google.cloud import aiplatform_v1 - def sample_list_entity_types(): + async def sample_list_entity_types(): # Create a client - client = aiplatform_v1.FeaturestoreServiceClient() + client = aiplatform_v1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ListEntityTypesRequest( @@ -1109,7 +1109,7 @@ def sample_list_entity_types(): page_result = client.list_entity_types(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1206,16 +1206,16 @@ async def update_entity_type( from google.cloud import aiplatform_v1 - def sample_update_entity_type(): + async def sample_update_entity_type(): # Create a client - client = aiplatform_v1.FeaturestoreServiceClient() + client = aiplatform_v1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.UpdateEntityTypeRequest( ) # Make the request - response = client.update_entity_type(request=request) + response = await client.update_entity_type(request=request) # Handle the response print(response) @@ -1337,9 +1337,9 @@ async def delete_entity_type( from google.cloud import aiplatform_v1 - def sample_delete_entity_type(): + async def sample_delete_entity_type(): # Create a client - client = aiplatform_v1.FeaturestoreServiceClient() + client = aiplatform_v1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.DeleteEntityTypeRequest( @@ -1351,7 +1351,7 @@ def sample_delete_entity_type(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1471,9 +1471,9 @@ async def create_feature( from google.cloud import aiplatform_v1 - def sample_create_feature(): + async def sample_create_feature(): # Create a client - client = aiplatform_v1.FeaturestoreServiceClient() + client = aiplatform_v1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) feature = aiplatform_v1.Feature() @@ -1490,7 +1490,7 @@ def sample_create_feature(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1611,9 +1611,9 @@ async def batch_create_features( from google.cloud import aiplatform_v1 - def sample_batch_create_features(): + async def sample_batch_create_features(): # Create a client - client = aiplatform_v1.FeaturestoreServiceClient() + client = aiplatform_v1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) requests = aiplatform_v1.CreateFeatureRequest() @@ -1631,7 +1631,7 @@ def sample_batch_create_features(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1742,9 +1742,9 @@ async def get_feature( from google.cloud import aiplatform_v1 - def sample_get_feature(): + async def sample_get_feature(): # Create a client - client = aiplatform_v1.FeaturestoreServiceClient() + client = aiplatform_v1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.GetFeatureRequest( @@ -1752,7 +1752,7 @@ def sample_get_feature(): ) # Make the request - response = client.get_feature(request=request) + response = await client.get_feature(request=request) # Handle the response print(response) @@ -1840,9 +1840,9 @@ async def list_features( from google.cloud import aiplatform_v1 - def sample_list_features(): + async def sample_list_features(): # Create a client - client = aiplatform_v1.FeaturestoreServiceClient() + client = aiplatform_v1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ListFeaturesRequest( @@ -1853,7 +1853,7 @@ def sample_list_features(): page_result = client.list_features(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1950,9 +1950,9 @@ async def update_feature( from google.cloud import aiplatform_v1 - def sample_update_feature(): + async def sample_update_feature(): # Create a client - client = aiplatform_v1.FeaturestoreServiceClient() + client = aiplatform_v1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) feature = aiplatform_v1.Feature() @@ -1963,7 +1963,7 @@ def sample_update_feature(): ) # Make the request - response = client.update_feature(request=request) + response = await client.update_feature(request=request) # Handle the response print(response) @@ -2075,9 +2075,9 @@ async def delete_feature( from google.cloud import aiplatform_v1 - def sample_delete_feature(): + async def sample_delete_feature(): # Create a client - client = aiplatform_v1.FeaturestoreServiceClient() + client = aiplatform_v1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.DeleteFeatureRequest( @@ -2089,7 +2089,7 @@ def sample_delete_feature(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -2216,9 +2216,9 @@ async def import_feature_values( from google.cloud import aiplatform_v1 - def sample_import_feature_values(): + async def sample_import_feature_values(): # Create a client - client = aiplatform_v1.FeaturestoreServiceClient() + client = aiplatform_v1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) avro_source = aiplatform_v1.AvroSource() @@ -2239,7 +2239,7 @@ def sample_import_feature_values(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -2345,9 +2345,9 @@ async def batch_read_feature_values( from google.cloud import aiplatform_v1 - def sample_batch_read_feature_values(): + async def sample_batch_read_feature_values(): # Create a client - client = aiplatform_v1.FeaturestoreServiceClient() + client = aiplatform_v1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) csv_read_instances = aiplatform_v1.CsvSource() @@ -2372,7 +2372,7 @@ def sample_batch_read_feature_values(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -2473,9 +2473,9 @@ async def export_feature_values( from google.cloud import aiplatform_v1 - def sample_export_feature_values(): + async def sample_export_feature_values(): # Create a client - client = aiplatform_v1.FeaturestoreServiceClient() + client = aiplatform_v1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) destination = aiplatform_v1.FeatureValueDestination() @@ -2495,7 +2495,7 @@ def sample_export_feature_values(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -2597,9 +2597,9 @@ async def search_features( from google.cloud import aiplatform_v1 - def sample_search_features(): + async def sample_search_features(): # Create a client - client = aiplatform_v1.FeaturestoreServiceClient() + client = aiplatform_v1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.SearchFeaturesRequest( @@ -2610,7 +2610,7 @@ def sample_search_features(): page_result = client.search_features(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: diff --git a/google/cloud/aiplatform_v1/services/index_endpoint_service/async_client.py b/google/cloud/aiplatform_v1/services/index_endpoint_service/async_client.py index eb1963c306..8df59343d4 100644 --- a/google/cloud/aiplatform_v1/services/index_endpoint_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/index_endpoint_service/async_client.py @@ -231,9 +231,9 @@ async def create_index_endpoint( from google.cloud import aiplatform_v1 - def sample_create_index_endpoint(): + async def sample_create_index_endpoint(): # Create a client - client = aiplatform_v1.IndexEndpointServiceClient() + client = aiplatform_v1.IndexEndpointServiceAsyncClient() # Initialize request argument(s) index_endpoint = aiplatform_v1.IndexEndpoint() @@ -249,7 +249,7 @@ def sample_create_index_endpoint(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -354,9 +354,9 @@ async def get_index_endpoint( from google.cloud import aiplatform_v1 - def sample_get_index_endpoint(): + async def sample_get_index_endpoint(): # Create a client - client = aiplatform_v1.IndexEndpointServiceClient() + client = aiplatform_v1.IndexEndpointServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.GetIndexEndpointRequest( @@ -364,7 +364,7 @@ def sample_get_index_endpoint(): ) # Make the request - response = client.get_index_endpoint(request=request) + response = await client.get_index_endpoint(request=request) # Handle the response print(response) @@ -451,9 +451,9 @@ async def list_index_endpoints( from google.cloud import aiplatform_v1 - def sample_list_index_endpoints(): + async def sample_list_index_endpoints(): # Create a client - client = aiplatform_v1.IndexEndpointServiceClient() + client = aiplatform_v1.IndexEndpointServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ListIndexEndpointsRequest( @@ -464,7 +464,7 @@ def sample_list_index_endpoints(): page_result = client.list_index_endpoints(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -561,9 +561,9 @@ async def update_index_endpoint( from google.cloud import aiplatform_v1 - def sample_update_index_endpoint(): + async def sample_update_index_endpoint(): # Create a client - client = aiplatform_v1.IndexEndpointServiceClient() + client = aiplatform_v1.IndexEndpointServiceAsyncClient() # Initialize request argument(s) index_endpoint = aiplatform_v1.IndexEndpoint() @@ -574,7 +574,7 @@ def sample_update_index_endpoint(): ) # Make the request - response = client.update_index_endpoint(request=request) + response = await client.update_index_endpoint(request=request) # Handle the response print(response) @@ -671,9 +671,9 @@ async def delete_index_endpoint( from google.cloud import aiplatform_v1 - def sample_delete_index_endpoint(): + async def sample_delete_index_endpoint(): # Create a client - client = aiplatform_v1.IndexEndpointServiceClient() + client = aiplatform_v1.IndexEndpointServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.DeleteIndexEndpointRequest( @@ -685,7 +685,7 @@ def sample_delete_index_endpoint(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -795,9 +795,9 @@ async def deploy_index( from google.cloud import aiplatform_v1 - def sample_deploy_index(): + async def sample_deploy_index(): # Create a client - client = aiplatform_v1.IndexEndpointServiceClient() + client = aiplatform_v1.IndexEndpointServiceAsyncClient() # Initialize request argument(s) deployed_index = aiplatform_v1.DeployedIndex() @@ -814,7 +814,7 @@ def sample_deploy_index(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -926,9 +926,9 @@ async def undeploy_index( from google.cloud import aiplatform_v1 - def sample_undeploy_index(): + async def sample_undeploy_index(): # Create a client - client = aiplatform_v1.IndexEndpointServiceClient() + client = aiplatform_v1.IndexEndpointServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.UndeployIndexRequest( @@ -941,7 +941,7 @@ def sample_undeploy_index(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1052,9 +1052,9 @@ async def mutate_deployed_index( from google.cloud import aiplatform_v1 - def sample_mutate_deployed_index(): + async def sample_mutate_deployed_index(): # Create a client - client = aiplatform_v1.IndexEndpointServiceClient() + client = aiplatform_v1.IndexEndpointServiceAsyncClient() # Initialize request argument(s) deployed_index = aiplatform_v1.DeployedIndex() @@ -1071,7 +1071,7 @@ def sample_mutate_deployed_index(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) diff --git a/google/cloud/aiplatform_v1/services/index_service/async_client.py b/google/cloud/aiplatform_v1/services/index_service/async_client.py index 8f237cce9a..627e8ad637 100644 --- a/google/cloud/aiplatform_v1/services/index_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/index_service/async_client.py @@ -230,9 +230,9 @@ async def create_index( from google.cloud import aiplatform_v1 - def sample_create_index(): + async def sample_create_index(): # Create a client - client = aiplatform_v1.IndexServiceClient() + client = aiplatform_v1.IndexServiceAsyncClient() # Initialize request argument(s) index = aiplatform_v1.Index() @@ -248,7 +248,7 @@ def sample_create_index(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -352,9 +352,9 @@ async def get_index( from google.cloud import aiplatform_v1 - def sample_get_index(): + async def sample_get_index(): # Create a client - client = aiplatform_v1.IndexServiceClient() + client = aiplatform_v1.IndexServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.GetIndexRequest( @@ -362,7 +362,7 @@ def sample_get_index(): ) # Make the request - response = client.get_index(request=request) + response = await client.get_index(request=request) # Handle the response print(response) @@ -449,9 +449,9 @@ async def list_indexes( from google.cloud import aiplatform_v1 - def sample_list_indexes(): + async def sample_list_indexes(): # Create a client - client = aiplatform_v1.IndexServiceClient() + client = aiplatform_v1.IndexServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ListIndexesRequest( @@ -462,7 +462,7 @@ def sample_list_indexes(): page_result = client.list_indexes(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -559,9 +559,9 @@ async def update_index( from google.cloud import aiplatform_v1 - def sample_update_index(): + async def sample_update_index(): # Create a client - client = aiplatform_v1.IndexServiceClient() + client = aiplatform_v1.IndexServiceAsyncClient() # Initialize request argument(s) index = aiplatform_v1.Index() @@ -576,7 +576,7 @@ def sample_update_index(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -686,9 +686,9 @@ async def delete_index( from google.cloud import aiplatform_v1 - def sample_delete_index(): + async def sample_delete_index(): # Create a client - client = aiplatform_v1.IndexServiceClient() + client = aiplatform_v1.IndexServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.DeleteIndexRequest( @@ -700,7 +700,7 @@ def sample_delete_index(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) diff --git a/google/cloud/aiplatform_v1/services/job_service/async_client.py b/google/cloud/aiplatform_v1/services/job_service/async_client.py index b655592a55..64b5a2caac 100644 --- a/google/cloud/aiplatform_v1/services/job_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/job_service/async_client.py @@ -281,9 +281,9 @@ async def create_custom_job( from google.cloud import aiplatform_v1 - def sample_create_custom_job(): + async def sample_create_custom_job(): # Create a client - client = aiplatform_v1.JobServiceClient() + client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) custom_job = aiplatform_v1.CustomJob() @@ -296,7 +296,7 @@ def sample_create_custom_job(): ) # Make the request - response = client.create_custom_job(request=request) + response = await client.create_custom_job(request=request) # Handle the response print(response) @@ -395,9 +395,9 @@ async def get_custom_job( from google.cloud import aiplatform_v1 - def sample_get_custom_job(): + async def sample_get_custom_job(): # Create a client - client = aiplatform_v1.JobServiceClient() + client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.GetCustomJobRequest( @@ -405,7 +405,7 @@ def sample_get_custom_job(): ) # Make the request - response = client.get_custom_job(request=request) + response = await client.get_custom_job(request=request) # Handle the response print(response) @@ -496,9 +496,9 @@ async def list_custom_jobs( from google.cloud import aiplatform_v1 - def sample_list_custom_jobs(): + async def sample_list_custom_jobs(): # Create a client - client = aiplatform_v1.JobServiceClient() + client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ListCustomJobsRequest( @@ -509,7 +509,7 @@ def sample_list_custom_jobs(): page_result = client.list_custom_jobs(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -605,9 +605,9 @@ async def delete_custom_job( from google.cloud import aiplatform_v1 - def sample_delete_custom_job(): + async def sample_delete_custom_job(): # Create a client - client = aiplatform_v1.JobServiceClient() + client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.DeleteCustomJobRequest( @@ -619,7 +619,7 @@ def sample_delete_custom_job(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -738,9 +738,9 @@ async def cancel_custom_job( from google.cloud import aiplatform_v1 - def sample_cancel_custom_job(): + async def sample_cancel_custom_job(): # Create a client - client = aiplatform_v1.JobServiceClient() + client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.CancelCustomJobRequest( @@ -748,7 +748,7 @@ def sample_cancel_custom_job(): ) # Make the request - client.cancel_custom_job(request=request) + await client.cancel_custom_job(request=request) Args: request (Union[google.cloud.aiplatform_v1.types.CancelCustomJobRequest, dict]): @@ -822,9 +822,9 @@ async def create_data_labeling_job( from google.cloud import aiplatform_v1 - def sample_create_data_labeling_job(): + async def sample_create_data_labeling_job(): # Create a client - client = aiplatform_v1.JobServiceClient() + client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) data_labeling_job = aiplatform_v1.DataLabelingJob() @@ -841,7 +841,7 @@ def sample_create_data_labeling_job(): ) # Make the request - response = client.create_data_labeling_job(request=request) + response = await client.create_data_labeling_job(request=request) # Handle the response print(response) @@ -936,9 +936,9 @@ async def get_data_labeling_job( from google.cloud import aiplatform_v1 - def sample_get_data_labeling_job(): + async def sample_get_data_labeling_job(): # Create a client - client = aiplatform_v1.JobServiceClient() + client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.GetDataLabelingJobRequest( @@ -946,7 +946,7 @@ def sample_get_data_labeling_job(): ) # Make the request - response = client.get_data_labeling_job(request=request) + response = await client.get_data_labeling_job(request=request) # Handle the response print(response) @@ -1032,9 +1032,9 @@ async def list_data_labeling_jobs( from google.cloud import aiplatform_v1 - def sample_list_data_labeling_jobs(): + async def sample_list_data_labeling_jobs(): # Create a client - client = aiplatform_v1.JobServiceClient() + client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ListDataLabelingJobsRequest( @@ -1045,7 +1045,7 @@ def sample_list_data_labeling_jobs(): page_result = client.list_data_labeling_jobs(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1140,9 +1140,9 @@ async def delete_data_labeling_job( from google.cloud import aiplatform_v1 - def sample_delete_data_labeling_job(): + async def sample_delete_data_labeling_job(): # Create a client - client = aiplatform_v1.JobServiceClient() + client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.DeleteDataLabelingJobRequest( @@ -1154,7 +1154,7 @@ def sample_delete_data_labeling_job(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1262,9 +1262,9 @@ async def cancel_data_labeling_job( from google.cloud import aiplatform_v1 - def sample_cancel_data_labeling_job(): + async def sample_cancel_data_labeling_job(): # Create a client - client = aiplatform_v1.JobServiceClient() + client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.CancelDataLabelingJobRequest( @@ -1272,7 +1272,7 @@ def sample_cancel_data_labeling_job(): ) # Make the request - client.cancel_data_labeling_job(request=request) + await client.cancel_data_labeling_job(request=request) Args: request (Union[google.cloud.aiplatform_v1.types.CancelDataLabelingJobRequest, dict]): @@ -1346,9 +1346,9 @@ async def create_hyperparameter_tuning_job( from google.cloud import aiplatform_v1 - def sample_create_hyperparameter_tuning_job(): + async def sample_create_hyperparameter_tuning_job(): # Create a client - client = aiplatform_v1.JobServiceClient() + client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) hyperparameter_tuning_job = aiplatform_v1.HyperparameterTuningJob() @@ -1368,7 +1368,7 @@ def sample_create_hyperparameter_tuning_job(): ) # Make the request - response = client.create_hyperparameter_tuning_job(request=request) + response = await client.create_hyperparameter_tuning_job(request=request) # Handle the response print(response) @@ -1465,9 +1465,9 @@ async def get_hyperparameter_tuning_job( from google.cloud import aiplatform_v1 - def sample_get_hyperparameter_tuning_job(): + async def sample_get_hyperparameter_tuning_job(): # Create a client - client = aiplatform_v1.JobServiceClient() + client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.GetHyperparameterTuningJobRequest( @@ -1475,7 +1475,7 @@ def sample_get_hyperparameter_tuning_job(): ) # Make the request - response = client.get_hyperparameter_tuning_job(request=request) + response = await client.get_hyperparameter_tuning_job(request=request) # Handle the response print(response) @@ -1563,9 +1563,9 @@ async def list_hyperparameter_tuning_jobs( from google.cloud import aiplatform_v1 - def sample_list_hyperparameter_tuning_jobs(): + async def sample_list_hyperparameter_tuning_jobs(): # Create a client - client = aiplatform_v1.JobServiceClient() + client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ListHyperparameterTuningJobsRequest( @@ -1576,7 +1576,7 @@ def sample_list_hyperparameter_tuning_jobs(): page_result = client.list_hyperparameter_tuning_jobs(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1672,9 +1672,9 @@ async def delete_hyperparameter_tuning_job( from google.cloud import aiplatform_v1 - def sample_delete_hyperparameter_tuning_job(): + async def sample_delete_hyperparameter_tuning_job(): # Create a client - client = aiplatform_v1.JobServiceClient() + client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.DeleteHyperparameterTuningJobRequest( @@ -1686,7 +1686,7 @@ def sample_delete_hyperparameter_tuning_job(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1806,9 +1806,9 @@ async def cancel_hyperparameter_tuning_job( from google.cloud import aiplatform_v1 - def sample_cancel_hyperparameter_tuning_job(): + async def sample_cancel_hyperparameter_tuning_job(): # Create a client - client = aiplatform_v1.JobServiceClient() + client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.CancelHyperparameterTuningJobRequest( @@ -1816,7 +1816,7 @@ def sample_cancel_hyperparameter_tuning_job(): ) # Make the request - client.cancel_hyperparameter_tuning_job(request=request) + await client.cancel_hyperparameter_tuning_job(request=request) Args: request (Union[google.cloud.aiplatform_v1.types.CancelHyperparameterTuningJobRequest, dict]): @@ -1892,9 +1892,9 @@ async def create_batch_prediction_job( from google.cloud import aiplatform_v1 - def sample_create_batch_prediction_job(): + async def sample_create_batch_prediction_job(): # Create a client - client = aiplatform_v1.JobServiceClient() + client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) batch_prediction_job = aiplatform_v1.BatchPredictionJob() @@ -1910,7 +1910,7 @@ def sample_create_batch_prediction_job(): ) # Make the request - response = client.create_batch_prediction_job(request=request) + response = await client.create_batch_prediction_job(request=request) # Handle the response print(response) @@ -2009,9 +2009,9 @@ async def get_batch_prediction_job( from google.cloud import aiplatform_v1 - def sample_get_batch_prediction_job(): + async def sample_get_batch_prediction_job(): # Create a client - client = aiplatform_v1.JobServiceClient() + client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.GetBatchPredictionJobRequest( @@ -2019,7 +2019,7 @@ def sample_get_batch_prediction_job(): ) # Make the request - response = client.get_batch_prediction_job(request=request) + response = await client.get_batch_prediction_job(request=request) # Handle the response print(response) @@ -2109,9 +2109,9 @@ async def list_batch_prediction_jobs( from google.cloud import aiplatform_v1 - def sample_list_batch_prediction_jobs(): + async def sample_list_batch_prediction_jobs(): # Create a client - client = aiplatform_v1.JobServiceClient() + client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ListBatchPredictionJobsRequest( @@ -2122,7 +2122,7 @@ def sample_list_batch_prediction_jobs(): page_result = client.list_batch_prediction_jobs(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -2219,9 +2219,9 @@ async def delete_batch_prediction_job( from google.cloud import aiplatform_v1 - def sample_delete_batch_prediction_job(): + async def sample_delete_batch_prediction_job(): # Create a client - client = aiplatform_v1.JobServiceClient() + client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.DeleteBatchPredictionJobRequest( @@ -2233,7 +2233,7 @@ def sample_delete_batch_prediction_job(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -2351,9 +2351,9 @@ async def cancel_batch_prediction_job( from google.cloud import aiplatform_v1 - def sample_cancel_batch_prediction_job(): + async def sample_cancel_batch_prediction_job(): # Create a client - client = aiplatform_v1.JobServiceClient() + client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.CancelBatchPredictionJobRequest( @@ -2361,7 +2361,7 @@ def sample_cancel_batch_prediction_job(): ) # Make the request - client.cancel_batch_prediction_job(request=request) + await client.cancel_batch_prediction_job(request=request) Args: request (Union[google.cloud.aiplatform_v1.types.CancelBatchPredictionJobRequest, dict]): @@ -2439,9 +2439,9 @@ async def create_model_deployment_monitoring_job( from google.cloud import aiplatform_v1 - def sample_create_model_deployment_monitoring_job(): + async def sample_create_model_deployment_monitoring_job(): # Create a client - client = aiplatform_v1.JobServiceClient() + client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) model_deployment_monitoring_job = aiplatform_v1.ModelDeploymentMonitoringJob() @@ -2454,7 +2454,7 @@ def sample_create_model_deployment_monitoring_job(): ) # Make the request - response = client.create_model_deployment_monitoring_job(request=request) + response = await client.create_model_deployment_monitoring_job(request=request) # Handle the response print(response) @@ -2556,9 +2556,9 @@ async def search_model_deployment_monitoring_stats_anomalies( from google.cloud import aiplatform_v1 - def sample_search_model_deployment_monitoring_stats_anomalies(): + async def sample_search_model_deployment_monitoring_stats_anomalies(): # Create a client - client = aiplatform_v1.JobServiceClient() + client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.SearchModelDeploymentMonitoringStatsAnomaliesRequest( @@ -2570,7 +2570,7 @@ def sample_search_model_deployment_monitoring_stats_anomalies(): page_result = client.search_model_deployment_monitoring_stats_anomalies(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -2684,9 +2684,9 @@ async def get_model_deployment_monitoring_job( from google.cloud import aiplatform_v1 - def sample_get_model_deployment_monitoring_job(): + async def sample_get_model_deployment_monitoring_job(): # Create a client - client = aiplatform_v1.JobServiceClient() + client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.GetModelDeploymentMonitoringJobRequest( @@ -2694,7 +2694,7 @@ def sample_get_model_deployment_monitoring_job(): ) # Make the request - response = client.get_model_deployment_monitoring_job(request=request) + response = await client.get_model_deployment_monitoring_job(request=request) # Handle the response print(response) @@ -2785,9 +2785,9 @@ async def list_model_deployment_monitoring_jobs( from google.cloud import aiplatform_v1 - def sample_list_model_deployment_monitoring_jobs(): + async def sample_list_model_deployment_monitoring_jobs(): # Create a client - client = aiplatform_v1.JobServiceClient() + client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ListModelDeploymentMonitoringJobsRequest( @@ -2798,7 +2798,7 @@ def sample_list_model_deployment_monitoring_jobs(): page_result = client.list_model_deployment_monitoring_jobs(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -2897,9 +2897,9 @@ async def update_model_deployment_monitoring_job( from google.cloud import aiplatform_v1 - def sample_update_model_deployment_monitoring_job(): + async def sample_update_model_deployment_monitoring_job(): # Create a client - client = aiplatform_v1.JobServiceClient() + client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) model_deployment_monitoring_job = aiplatform_v1.ModelDeploymentMonitoringJob() @@ -2915,7 +2915,7 @@ def sample_update_model_deployment_monitoring_job(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -3056,9 +3056,9 @@ async def delete_model_deployment_monitoring_job( from google.cloud import aiplatform_v1 - def sample_delete_model_deployment_monitoring_job(): + async def sample_delete_model_deployment_monitoring_job(): # Create a client - client = aiplatform_v1.JobServiceClient() + client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.DeleteModelDeploymentMonitoringJobRequest( @@ -3070,7 +3070,7 @@ def sample_delete_model_deployment_monitoring_job(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -3182,9 +3182,9 @@ async def pause_model_deployment_monitoring_job( from google.cloud import aiplatform_v1 - def sample_pause_model_deployment_monitoring_job(): + async def sample_pause_model_deployment_monitoring_job(): # Create a client - client = aiplatform_v1.JobServiceClient() + client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.PauseModelDeploymentMonitoringJobRequest( @@ -3192,7 +3192,7 @@ def sample_pause_model_deployment_monitoring_job(): ) # Make the request - client.pause_model_deployment_monitoring_job(request=request) + await client.pause_model_deployment_monitoring_job(request=request) Args: request (Union[google.cloud.aiplatform_v1.types.PauseModelDeploymentMonitoringJobRequest, dict]): @@ -3270,9 +3270,9 @@ async def resume_model_deployment_monitoring_job( from google.cloud import aiplatform_v1 - def sample_resume_model_deployment_monitoring_job(): + async def sample_resume_model_deployment_monitoring_job(): # Create a client - client = aiplatform_v1.JobServiceClient() + client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ResumeModelDeploymentMonitoringJobRequest( @@ -3280,7 +3280,7 @@ def sample_resume_model_deployment_monitoring_job(): ) # Make the request - client.resume_model_deployment_monitoring_job(request=request) + await client.resume_model_deployment_monitoring_job(request=request) Args: request (Union[google.cloud.aiplatform_v1.types.ResumeModelDeploymentMonitoringJobRequest, dict]): diff --git a/google/cloud/aiplatform_v1/services/metadata_service/async_client.py b/google/cloud/aiplatform_v1/services/metadata_service/async_client.py index c9d70b09e5..36f26488c0 100644 --- a/google/cloud/aiplatform_v1/services/metadata_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/metadata_service/async_client.py @@ -252,9 +252,9 @@ async def create_metadata_store( from google.cloud import aiplatform_v1 - def sample_create_metadata_store(): + async def sample_create_metadata_store(): # Create a client - client = aiplatform_v1.MetadataServiceClient() + client = aiplatform_v1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.CreateMetadataStoreRequest( @@ -266,7 +266,7 @@ def sample_create_metadata_store(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -388,9 +388,9 @@ async def get_metadata_store( from google.cloud import aiplatform_v1 - def sample_get_metadata_store(): + async def sample_get_metadata_store(): # Create a client - client = aiplatform_v1.MetadataServiceClient() + client = aiplatform_v1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.GetMetadataStoreRequest( @@ -398,7 +398,7 @@ def sample_get_metadata_store(): ) # Make the request - response = client.get_metadata_store(request=request) + response = await client.get_metadata_store(request=request) # Handle the response print(response) @@ -485,9 +485,9 @@ async def list_metadata_stores( from google.cloud import aiplatform_v1 - def sample_list_metadata_stores(): + async def sample_list_metadata_stores(): # Create a client - client = aiplatform_v1.MetadataServiceClient() + client = aiplatform_v1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ListMetadataStoresRequest( @@ -498,7 +498,7 @@ def sample_list_metadata_stores(): page_result = client.list_metadata_stores(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -595,9 +595,9 @@ async def delete_metadata_store( from google.cloud import aiplatform_v1 - def sample_delete_metadata_store(): + async def sample_delete_metadata_store(): # Create a client - client = aiplatform_v1.MetadataServiceClient() + client = aiplatform_v1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.DeleteMetadataStoreRequest( @@ -609,7 +609,7 @@ def sample_delete_metadata_store(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -718,9 +718,9 @@ async def create_artifact( from google.cloud import aiplatform_v1 - def sample_create_artifact(): + async def sample_create_artifact(): # Create a client - client = aiplatform_v1.MetadataServiceClient() + client = aiplatform_v1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.CreateArtifactRequest( @@ -728,7 +728,7 @@ def sample_create_artifact(): ) # Make the request - response = client.create_artifact(request=request) + response = await client.create_artifact(request=request) # Handle the response print(response) @@ -836,9 +836,9 @@ async def get_artifact( from google.cloud import aiplatform_v1 - def sample_get_artifact(): + async def sample_get_artifact(): # Create a client - client = aiplatform_v1.MetadataServiceClient() + client = aiplatform_v1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.GetArtifactRequest( @@ -846,7 +846,7 @@ def sample_get_artifact(): ) # Make the request - response = client.get_artifact(request=request) + response = await client.get_artifact(request=request) # Handle the response print(response) @@ -930,9 +930,9 @@ async def list_artifacts( from google.cloud import aiplatform_v1 - def sample_list_artifacts(): + async def sample_list_artifacts(): # Create a client - client = aiplatform_v1.MetadataServiceClient() + client = aiplatform_v1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ListArtifactsRequest( @@ -943,7 +943,7 @@ def sample_list_artifacts(): page_result = client.list_artifacts(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1040,16 +1040,16 @@ async def update_artifact( from google.cloud import aiplatform_v1 - def sample_update_artifact(): + async def sample_update_artifact(): # Create a client - client = aiplatform_v1.MetadataServiceClient() + client = aiplatform_v1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.UpdateArtifactRequest( ) # Make the request - response = client.update_artifact(request=request) + response = await client.update_artifact(request=request) # Handle the response print(response) @@ -1149,9 +1149,9 @@ async def delete_artifact( from google.cloud import aiplatform_v1 - def sample_delete_artifact(): + async def sample_delete_artifact(): # Create a client - client = aiplatform_v1.MetadataServiceClient() + client = aiplatform_v1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.DeleteArtifactRequest( @@ -1163,7 +1163,7 @@ def sample_delete_artifact(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1270,9 +1270,9 @@ async def purge_artifacts( from google.cloud import aiplatform_v1 - def sample_purge_artifacts(): + async def sample_purge_artifacts(): # Create a client - client = aiplatform_v1.MetadataServiceClient() + client = aiplatform_v1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.PurgeArtifactsRequest( @@ -1285,7 +1285,7 @@ def sample_purge_artifacts(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1385,9 +1385,9 @@ async def create_context( from google.cloud import aiplatform_v1 - def sample_create_context(): + async def sample_create_context(): # Create a client - client = aiplatform_v1.MetadataServiceClient() + client = aiplatform_v1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.CreateContextRequest( @@ -1395,7 +1395,7 @@ def sample_create_context(): ) # Make the request - response = client.create_context(request=request) + response = await client.create_context(request=request) # Handle the response print(response) @@ -1503,9 +1503,9 @@ async def get_context( from google.cloud import aiplatform_v1 - def sample_get_context(): + async def sample_get_context(): # Create a client - client = aiplatform_v1.MetadataServiceClient() + client = aiplatform_v1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.GetContextRequest( @@ -1513,7 +1513,7 @@ def sample_get_context(): ) # Make the request - response = client.get_context(request=request) + response = await client.get_context(request=request) # Handle the response print(response) @@ -1597,9 +1597,9 @@ async def list_contexts( from google.cloud import aiplatform_v1 - def sample_list_contexts(): + async def sample_list_contexts(): # Create a client - client = aiplatform_v1.MetadataServiceClient() + client = aiplatform_v1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ListContextsRequest( @@ -1610,7 +1610,7 @@ def sample_list_contexts(): page_result = client.list_contexts(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1707,16 +1707,16 @@ async def update_context( from google.cloud import aiplatform_v1 - def sample_update_context(): + async def sample_update_context(): # Create a client - client = aiplatform_v1.MetadataServiceClient() + client = aiplatform_v1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.UpdateContextRequest( ) # Make the request - response = client.update_context(request=request) + response = await client.update_context(request=request) # Handle the response print(response) @@ -1815,9 +1815,9 @@ async def delete_context( from google.cloud import aiplatform_v1 - def sample_delete_context(): + async def sample_delete_context(): # Create a client - client = aiplatform_v1.MetadataServiceClient() + client = aiplatform_v1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.DeleteContextRequest( @@ -1829,7 +1829,7 @@ def sample_delete_context(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1936,9 +1936,9 @@ async def purge_contexts( from google.cloud import aiplatform_v1 - def sample_purge_contexts(): + async def sample_purge_contexts(): # Create a client - client = aiplatform_v1.MetadataServiceClient() + client = aiplatform_v1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.PurgeContextsRequest( @@ -1951,7 +1951,7 @@ def sample_purge_contexts(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -2055,9 +2055,9 @@ async def add_context_artifacts_and_executions( from google.cloud import aiplatform_v1 - def sample_add_context_artifacts_and_executions(): + async def sample_add_context_artifacts_and_executions(): # Create a client - client = aiplatform_v1.MetadataServiceClient() + client = aiplatform_v1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.AddContextArtifactsAndExecutionsRequest( @@ -2065,7 +2065,7 @@ def sample_add_context_artifacts_and_executions(): ) # Make the request - response = client.add_context_artifacts_and_executions(request=request) + response = await client.add_context_artifacts_and_executions(request=request) # Handle the response print(response) @@ -2180,9 +2180,9 @@ async def add_context_children( from google.cloud import aiplatform_v1 - def sample_add_context_children(): + async def sample_add_context_children(): # Create a client - client = aiplatform_v1.MetadataServiceClient() + client = aiplatform_v1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.AddContextChildrenRequest( @@ -2190,7 +2190,7 @@ def sample_add_context_children(): ) # Make the request - response = client.add_context_children(request=request) + response = await client.add_context_children(request=request) # Handle the response print(response) @@ -2290,9 +2290,9 @@ async def query_context_lineage_subgraph( from google.cloud import aiplatform_v1 - def sample_query_context_lineage_subgraph(): + async def sample_query_context_lineage_subgraph(): # Create a client - client = aiplatform_v1.MetadataServiceClient() + client = aiplatform_v1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.QueryContextLineageSubgraphRequest( @@ -2300,7 +2300,7 @@ def sample_query_context_lineage_subgraph(): ) # Make the request - response = client.query_context_lineage_subgraph(request=request) + response = await client.query_context_lineage_subgraph(request=request) # Handle the response print(response) @@ -2395,9 +2395,9 @@ async def create_execution( from google.cloud import aiplatform_v1 - def sample_create_execution(): + async def sample_create_execution(): # Create a client - client = aiplatform_v1.MetadataServiceClient() + client = aiplatform_v1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.CreateExecutionRequest( @@ -2405,7 +2405,7 @@ def sample_create_execution(): ) # Make the request - response = client.create_execution(request=request) + response = await client.create_execution(request=request) # Handle the response print(response) @@ -2513,9 +2513,9 @@ async def get_execution( from google.cloud import aiplatform_v1 - def sample_get_execution(): + async def sample_get_execution(): # Create a client - client = aiplatform_v1.MetadataServiceClient() + client = aiplatform_v1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.GetExecutionRequest( @@ -2523,7 +2523,7 @@ def sample_get_execution(): ) # Make the request - response = client.get_execution(request=request) + response = await client.get_execution(request=request) # Handle the response print(response) @@ -2607,9 +2607,9 @@ async def list_executions( from google.cloud import aiplatform_v1 - def sample_list_executions(): + async def sample_list_executions(): # Create a client - client = aiplatform_v1.MetadataServiceClient() + client = aiplatform_v1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ListExecutionsRequest( @@ -2620,7 +2620,7 @@ def sample_list_executions(): page_result = client.list_executions(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -2717,16 +2717,16 @@ async def update_execution( from google.cloud import aiplatform_v1 - def sample_update_execution(): + async def sample_update_execution(): # Create a client - client = aiplatform_v1.MetadataServiceClient() + client = aiplatform_v1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.UpdateExecutionRequest( ) # Make the request - response = client.update_execution(request=request) + response = await client.update_execution(request=request) # Handle the response print(response) @@ -2826,9 +2826,9 @@ async def delete_execution( from google.cloud import aiplatform_v1 - def sample_delete_execution(): + async def sample_delete_execution(): # Create a client - client = aiplatform_v1.MetadataServiceClient() + client = aiplatform_v1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.DeleteExecutionRequest( @@ -2840,7 +2840,7 @@ def sample_delete_execution(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -2947,9 +2947,9 @@ async def purge_executions( from google.cloud import aiplatform_v1 - def sample_purge_executions(): + async def sample_purge_executions(): # Create a client - client = aiplatform_v1.MetadataServiceClient() + client = aiplatform_v1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.PurgeExecutionsRequest( @@ -2962,7 +2962,7 @@ def sample_purge_executions(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -3065,9 +3065,9 @@ async def add_execution_events( from google.cloud import aiplatform_v1 - def sample_add_execution_events(): + async def sample_add_execution_events(): # Create a client - client = aiplatform_v1.MetadataServiceClient() + client = aiplatform_v1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.AddExecutionEventsRequest( @@ -3075,7 +3075,7 @@ def sample_add_execution_events(): ) # Make the request - response = client.add_execution_events(request=request) + response = await client.add_execution_events(request=request) # Handle the response print(response) @@ -3174,9 +3174,9 @@ async def query_execution_inputs_and_outputs( from google.cloud import aiplatform_v1 - def sample_query_execution_inputs_and_outputs(): + async def sample_query_execution_inputs_and_outputs(): # Create a client - client = aiplatform_v1.MetadataServiceClient() + client = aiplatform_v1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.QueryExecutionInputsAndOutputsRequest( @@ -3184,7 +3184,7 @@ def sample_query_execution_inputs_and_outputs(): ) # Make the request - response = client.query_execution_inputs_and_outputs(request=request) + response = await client.query_execution_inputs_and_outputs(request=request) # Handle the response print(response) @@ -3276,9 +3276,9 @@ async def create_metadata_schema( from google.cloud import aiplatform_v1 - def sample_create_metadata_schema(): + async def sample_create_metadata_schema(): # Create a client - client = aiplatform_v1.MetadataServiceClient() + client = aiplatform_v1.MetadataServiceAsyncClient() # Initialize request argument(s) metadata_schema = aiplatform_v1.MetadataSchema() @@ -3290,7 +3290,7 @@ def sample_create_metadata_schema(): ) # Make the request - response = client.create_metadata_schema(request=request) + response = await client.create_metadata_schema(request=request) # Handle the response print(response) @@ -3400,9 +3400,9 @@ async def get_metadata_schema( from google.cloud import aiplatform_v1 - def sample_get_metadata_schema(): + async def sample_get_metadata_schema(): # Create a client - client = aiplatform_v1.MetadataServiceClient() + client = aiplatform_v1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.GetMetadataSchemaRequest( @@ -3410,7 +3410,7 @@ def sample_get_metadata_schema(): ) # Make the request - response = client.get_metadata_schema(request=request) + response = await client.get_metadata_schema(request=request) # Handle the response print(response) @@ -3494,9 +3494,9 @@ async def list_metadata_schemas( from google.cloud import aiplatform_v1 - def sample_list_metadata_schemas(): + async def sample_list_metadata_schemas(): # Create a client - client = aiplatform_v1.MetadataServiceClient() + client = aiplatform_v1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ListMetadataSchemasRequest( @@ -3507,7 +3507,7 @@ def sample_list_metadata_schemas(): page_result = client.list_metadata_schemas(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -3607,9 +3607,9 @@ async def query_artifact_lineage_subgraph( from google.cloud import aiplatform_v1 - def sample_query_artifact_lineage_subgraph(): + async def sample_query_artifact_lineage_subgraph(): # Create a client - client = aiplatform_v1.MetadataServiceClient() + client = aiplatform_v1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.QueryArtifactLineageSubgraphRequest( @@ -3617,7 +3617,7 @@ def sample_query_artifact_lineage_subgraph(): ) # Make the request - response = client.query_artifact_lineage_subgraph(request=request) + response = await client.query_artifact_lineage_subgraph(request=request) # Handle the response print(response) diff --git a/google/cloud/aiplatform_v1/services/migration_service/async_client.py b/google/cloud/aiplatform_v1/services/migration_service/async_client.py index f2b774fc2c..1691261f71 100644 --- a/google/cloud/aiplatform_v1/services/migration_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/migration_service/async_client.py @@ -239,9 +239,9 @@ async def search_migratable_resources( from google.cloud import aiplatform_v1 - def sample_search_migratable_resources(): + async def sample_search_migratable_resources(): # Create a client - client = aiplatform_v1.MigrationServiceClient() + client = aiplatform_v1.MigrationServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.SearchMigratableResourcesRequest( @@ -252,7 +252,7 @@ def sample_search_migratable_resources(): page_result = client.search_migratable_resources(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -355,9 +355,9 @@ async def batch_migrate_resources( from google.cloud import aiplatform_v1 - def sample_batch_migrate_resources(): + async def sample_batch_migrate_resources(): # Create a client - client = aiplatform_v1.MigrationServiceClient() + client = aiplatform_v1.MigrationServiceAsyncClient() # Initialize request argument(s) migrate_resource_requests = aiplatform_v1.MigrateResourceRequest() @@ -375,7 +375,7 @@ def sample_batch_migrate_resources(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) diff --git a/google/cloud/aiplatform_v1/services/migration_service/client.py b/google/cloud/aiplatform_v1/services/migration_service/client.py index 4a34966ffa..99736fc796 100644 --- a/google/cloud/aiplatform_v1/services/migration_service/client.py +++ b/google/cloud/aiplatform_v1/services/migration_service/client.py @@ -192,23 +192,18 @@ def parse_annotated_dataset_path(path: str) -> Dict[str, str]: @staticmethod def dataset_path( project: str, - location: str, dataset: str, ) -> str: """Returns a fully-qualified dataset string.""" - return "projects/{project}/locations/{location}/datasets/{dataset}".format( + return "projects/{project}/datasets/{dataset}".format( project=project, - location=location, dataset=dataset, ) @staticmethod def parse_dataset_path(path: str) -> Dict[str, str]: """Parses a dataset path into its component segments.""" - m = re.match( - r"^projects/(?P.+?)/locations/(?P.+?)/datasets/(?P.+?)$", - path, - ) + m = re.match(r"^projects/(?P.+?)/datasets/(?P.+?)$", path) return m.groupdict() if m else {} @staticmethod @@ -236,18 +231,23 @@ def parse_dataset_path(path: str) -> Dict[str, str]: @staticmethod def dataset_path( project: str, + location: str, dataset: str, ) -> str: """Returns a fully-qualified dataset string.""" - return "projects/{project}/datasets/{dataset}".format( + return "projects/{project}/locations/{location}/datasets/{dataset}".format( project=project, + location=location, dataset=dataset, ) @staticmethod def parse_dataset_path(path: str) -> Dict[str, str]: """Parses a dataset path into its component segments.""" - m = re.match(r"^projects/(?P.+?)/datasets/(?P.+?)$", path) + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/datasets/(?P.+?)$", + path, + ) return m.groupdict() if m else {} @staticmethod diff --git a/google/cloud/aiplatform_v1/services/model_service/async_client.py b/google/cloud/aiplatform_v1/services/model_service/async_client.py index cf6d6b4e65..66f3b1e32a 100644 --- a/google/cloud/aiplatform_v1/services/model_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/model_service/async_client.py @@ -245,9 +245,9 @@ async def upload_model( from google.cloud import aiplatform_v1 - def sample_upload_model(): + async def sample_upload_model(): # Create a client - client = aiplatform_v1.ModelServiceClient() + client = aiplatform_v1.ModelServiceAsyncClient() # Initialize request argument(s) model = aiplatform_v1.Model() @@ -263,7 +263,7 @@ def sample_upload_model(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -369,9 +369,9 @@ async def get_model( from google.cloud import aiplatform_v1 - def sample_get_model(): + async def sample_get_model(): # Create a client - client = aiplatform_v1.ModelServiceClient() + client = aiplatform_v1.ModelServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.GetModelRequest( @@ -379,7 +379,7 @@ def sample_get_model(): ) # Make the request - response = client.get_model(request=request) + response = await client.get_model(request=request) # Handle the response print(response) @@ -462,9 +462,9 @@ async def list_models( from google.cloud import aiplatform_v1 - def sample_list_models(): + async def sample_list_models(): # Create a client - client = aiplatform_v1.ModelServiceClient() + client = aiplatform_v1.ModelServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ListModelsRequest( @@ -475,7 +475,7 @@ def sample_list_models(): page_result = client.list_models(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -572,9 +572,9 @@ async def update_model( from google.cloud import aiplatform_v1 - def sample_update_model(): + async def sample_update_model(): # Create a client - client = aiplatform_v1.ModelServiceClient() + client = aiplatform_v1.ModelServiceAsyncClient() # Initialize request argument(s) model = aiplatform_v1.Model() @@ -585,7 +585,7 @@ def sample_update_model(): ) # Make the request - response = client.update_model(request=request) + response = await client.update_model(request=request) # Handle the response print(response) @@ -708,9 +708,9 @@ async def delete_model( from google.cloud import aiplatform_v1 - def sample_delete_model(): + async def sample_delete_model(): # Create a client - client = aiplatform_v1.ModelServiceClient() + client = aiplatform_v1.ModelServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.DeleteModelRequest( @@ -722,7 +722,7 @@ def sample_delete_model(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -833,9 +833,9 @@ async def export_model( from google.cloud import aiplatform_v1 - def sample_export_model(): + async def sample_export_model(): # Create a client - client = aiplatform_v1.ModelServiceClient() + client = aiplatform_v1.ModelServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ExportModelRequest( @@ -847,7 +847,7 @@ def sample_export_model(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -955,9 +955,9 @@ async def import_model_evaluation( from google.cloud import aiplatform_v1 - def sample_import_model_evaluation(): + async def sample_import_model_evaluation(): # Create a client - client = aiplatform_v1.ModelServiceClient() + client = aiplatform_v1.ModelServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ImportModelEvaluationRequest( @@ -965,7 +965,7 @@ def sample_import_model_evaluation(): ) # Make the request - response = client.import_model_evaluation(request=request) + response = await client.import_model_evaluation(request=request) # Handle the response print(response) @@ -1061,9 +1061,9 @@ async def get_model_evaluation( from google.cloud import aiplatform_v1 - def sample_get_model_evaluation(): + async def sample_get_model_evaluation(): # Create a client - client = aiplatform_v1.ModelServiceClient() + client = aiplatform_v1.ModelServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.GetModelEvaluationRequest( @@ -1071,7 +1071,7 @@ def sample_get_model_evaluation(): ) # Make the request - response = client.get_model_evaluation(request=request) + response = await client.get_model_evaluation(request=request) # Handle the response print(response) @@ -1159,9 +1159,9 @@ async def list_model_evaluations( from google.cloud import aiplatform_v1 - def sample_list_model_evaluations(): + async def sample_list_model_evaluations(): # Create a client - client = aiplatform_v1.ModelServiceClient() + client = aiplatform_v1.ModelServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ListModelEvaluationsRequest( @@ -1172,7 +1172,7 @@ def sample_list_model_evaluations(): page_result = client.list_model_evaluations(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1268,9 +1268,9 @@ async def get_model_evaluation_slice( from google.cloud import aiplatform_v1 - def sample_get_model_evaluation_slice(): + async def sample_get_model_evaluation_slice(): # Create a client - client = aiplatform_v1.ModelServiceClient() + client = aiplatform_v1.ModelServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.GetModelEvaluationSliceRequest( @@ -1278,7 +1278,7 @@ def sample_get_model_evaluation_slice(): ) # Make the request - response = client.get_model_evaluation_slice(request=request) + response = await client.get_model_evaluation_slice(request=request) # Handle the response print(response) @@ -1366,9 +1366,9 @@ async def list_model_evaluation_slices( from google.cloud import aiplatform_v1 - def sample_list_model_evaluation_slices(): + async def sample_list_model_evaluation_slices(): # Create a client - client = aiplatform_v1.ModelServiceClient() + client = aiplatform_v1.ModelServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ListModelEvaluationSlicesRequest( @@ -1379,7 +1379,7 @@ def sample_list_model_evaluation_slices(): page_result = client.list_model_evaluation_slices(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: diff --git a/google/cloud/aiplatform_v1/services/pipeline_service/async_client.py b/google/cloud/aiplatform_v1/services/pipeline_service/async_client.py index ba8850b5a6..752fb1b102 100644 --- a/google/cloud/aiplatform_v1/services/pipeline_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/pipeline_service/async_client.py @@ -257,9 +257,9 @@ async def create_training_pipeline( from google.cloud import aiplatform_v1 - def sample_create_training_pipeline(): + async def sample_create_training_pipeline(): # Create a client - client = aiplatform_v1.PipelineServiceClient() + client = aiplatform_v1.PipelineServiceAsyncClient() # Initialize request argument(s) training_pipeline = aiplatform_v1.TrainingPipeline() @@ -273,7 +273,7 @@ def sample_create_training_pipeline(): ) # Make the request - response = client.create_training_pipeline(request=request) + response = await client.create_training_pipeline(request=request) # Handle the response print(response) @@ -372,9 +372,9 @@ async def get_training_pipeline( from google.cloud import aiplatform_v1 - def sample_get_training_pipeline(): + async def sample_get_training_pipeline(): # Create a client - client = aiplatform_v1.PipelineServiceClient() + client = aiplatform_v1.PipelineServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.GetTrainingPipelineRequest( @@ -382,7 +382,7 @@ def sample_get_training_pipeline(): ) # Make the request - response = client.get_training_pipeline(request=request) + response = await client.get_training_pipeline(request=request) # Handle the response print(response) @@ -472,9 +472,9 @@ async def list_training_pipelines( from google.cloud import aiplatform_v1 - def sample_list_training_pipelines(): + async def sample_list_training_pipelines(): # Create a client - client = aiplatform_v1.PipelineServiceClient() + client = aiplatform_v1.PipelineServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ListTrainingPipelinesRequest( @@ -485,7 +485,7 @@ def sample_list_training_pipelines(): page_result = client.list_training_pipelines(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -581,9 +581,9 @@ async def delete_training_pipeline( from google.cloud import aiplatform_v1 - def sample_delete_training_pipeline(): + async def sample_delete_training_pipeline(): # Create a client - client = aiplatform_v1.PipelineServiceClient() + client = aiplatform_v1.PipelineServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.DeleteTrainingPipelineRequest( @@ -595,7 +595,7 @@ def sample_delete_training_pipeline(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -714,9 +714,9 @@ async def cancel_training_pipeline( from google.cloud import aiplatform_v1 - def sample_cancel_training_pipeline(): + async def sample_cancel_training_pipeline(): # Create a client - client = aiplatform_v1.PipelineServiceClient() + client = aiplatform_v1.PipelineServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.CancelTrainingPipelineRequest( @@ -724,7 +724,7 @@ def sample_cancel_training_pipeline(): ) # Make the request - client.cancel_training_pipeline(request=request) + await client.cancel_training_pipeline(request=request) Args: request (Union[google.cloud.aiplatform_v1.types.CancelTrainingPipelineRequest, dict]): @@ -801,9 +801,9 @@ async def create_pipeline_job( from google.cloud import aiplatform_v1 - def sample_create_pipeline_job(): + async def sample_create_pipeline_job(): # Create a client - client = aiplatform_v1.PipelineServiceClient() + client = aiplatform_v1.PipelineServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.CreatePipelineJobRequest( @@ -811,7 +811,7 @@ def sample_create_pipeline_job(): ) # Make the request - response = client.create_pipeline_job(request=request) + response = await client.create_pipeline_job(request=request) # Handle the response print(response) @@ -917,9 +917,9 @@ async def get_pipeline_job( from google.cloud import aiplatform_v1 - def sample_get_pipeline_job(): + async def sample_get_pipeline_job(): # Create a client - client = aiplatform_v1.PipelineServiceClient() + client = aiplatform_v1.PipelineServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.GetPipelineJobRequest( @@ -927,7 +927,7 @@ def sample_get_pipeline_job(): ) # Make the request - response = client.get_pipeline_job(request=request) + response = await client.get_pipeline_job(request=request) # Handle the response print(response) @@ -1012,9 +1012,9 @@ async def list_pipeline_jobs( from google.cloud import aiplatform_v1 - def sample_list_pipeline_jobs(): + async def sample_list_pipeline_jobs(): # Create a client - client = aiplatform_v1.PipelineServiceClient() + client = aiplatform_v1.PipelineServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ListPipelineJobsRequest( @@ -1025,7 +1025,7 @@ def sample_list_pipeline_jobs(): page_result = client.list_pipeline_jobs(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1121,9 +1121,9 @@ async def delete_pipeline_job( from google.cloud import aiplatform_v1 - def sample_delete_pipeline_job(): + async def sample_delete_pipeline_job(): # Create a client - client = aiplatform_v1.PipelineServiceClient() + client = aiplatform_v1.PipelineServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.DeletePipelineJobRequest( @@ -1135,7 +1135,7 @@ def sample_delete_pipeline_job(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1254,9 +1254,9 @@ async def cancel_pipeline_job( from google.cloud import aiplatform_v1 - def sample_cancel_pipeline_job(): + async def sample_cancel_pipeline_job(): # Create a client - client = aiplatform_v1.PipelineServiceClient() + client = aiplatform_v1.PipelineServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.CancelPipelineJobRequest( @@ -1264,7 +1264,7 @@ def sample_cancel_pipeline_job(): ) # Make the request - client.cancel_pipeline_job(request=request) + await client.cancel_pipeline_job(request=request) Args: request (Union[google.cloud.aiplatform_v1.types.CancelPipelineJobRequest, dict]): diff --git a/google/cloud/aiplatform_v1/services/prediction_service/async_client.py b/google/cloud/aiplatform_v1/services/prediction_service/async_client.py index e3a8af7438..428120be9d 100644 --- a/google/cloud/aiplatform_v1/services/prediction_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/prediction_service/async_client.py @@ -224,9 +224,9 @@ async def predict( from google.cloud import aiplatform_v1 - def sample_predict(): + async def sample_predict(): # Create a client - client = aiplatform_v1.PredictionServiceClient() + client = aiplatform_v1.PredictionServiceAsyncClient() # Initialize request argument(s) instances = aiplatform_v1.Value() @@ -238,7 +238,7 @@ def sample_predict(): ) # Make the request - response = client.predict(request=request) + response = await client.predict(request=request) # Handle the response print(response) @@ -366,9 +366,9 @@ async def raw_predict( from google.cloud import aiplatform_v1 - def sample_raw_predict(): + async def sample_raw_predict(): # Create a client - client = aiplatform_v1.PredictionServiceClient() + client = aiplatform_v1.PredictionServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.RawPredictRequest( @@ -376,7 +376,7 @@ def sample_raw_predict(): ) # Make the request - response = client.raw_predict(request=request) + response = await client.raw_predict(request=request) # Handle the response print(response) @@ -548,9 +548,9 @@ async def explain( from google.cloud import aiplatform_v1 - def sample_explain(): + async def sample_explain(): # Create a client - client = aiplatform_v1.PredictionServiceClient() + client = aiplatform_v1.PredictionServiceAsyncClient() # Initialize request argument(s) instances = aiplatform_v1.Value() @@ -562,7 +562,7 @@ def sample_explain(): ) # Make the request - response = client.explain(request=request) + response = await client.explain(request=request) # Handle the response print(response) diff --git a/google/cloud/aiplatform_v1/services/specialist_pool_service/async_client.py b/google/cloud/aiplatform_v1/services/specialist_pool_service/async_client.py index c610573b18..37e77ea465 100644 --- a/google/cloud/aiplatform_v1/services/specialist_pool_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/specialist_pool_service/async_client.py @@ -240,9 +240,9 @@ async def create_specialist_pool( from google.cloud import aiplatform_v1 - def sample_create_specialist_pool(): + async def sample_create_specialist_pool(): # Create a client - client = aiplatform_v1.SpecialistPoolServiceClient() + client = aiplatform_v1.SpecialistPoolServiceAsyncClient() # Initialize request argument(s) specialist_pool = aiplatform_v1.SpecialistPool() @@ -259,7 +259,7 @@ def sample_create_specialist_pool(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -370,9 +370,9 @@ async def get_specialist_pool( from google.cloud import aiplatform_v1 - def sample_get_specialist_pool(): + async def sample_get_specialist_pool(): # Create a client - client = aiplatform_v1.SpecialistPoolServiceClient() + client = aiplatform_v1.SpecialistPoolServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.GetSpecialistPoolRequest( @@ -380,7 +380,7 @@ def sample_get_specialist_pool(): ) # Make the request - response = client.get_specialist_pool(request=request) + response = await client.get_specialist_pool(request=request) # Handle the response print(response) @@ -476,9 +476,9 @@ async def list_specialist_pools( from google.cloud import aiplatform_v1 - def sample_list_specialist_pools(): + async def sample_list_specialist_pools(): # Create a client - client = aiplatform_v1.SpecialistPoolServiceClient() + client = aiplatform_v1.SpecialistPoolServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ListSpecialistPoolsRequest( @@ -489,7 +489,7 @@ def sample_list_specialist_pools(): page_result = client.list_specialist_pools(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -588,9 +588,9 @@ async def delete_specialist_pool( from google.cloud import aiplatform_v1 - def sample_delete_specialist_pool(): + async def sample_delete_specialist_pool(): # Create a client - client = aiplatform_v1.SpecialistPoolServiceClient() + client = aiplatform_v1.SpecialistPoolServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.DeleteSpecialistPoolRequest( @@ -602,7 +602,7 @@ def sample_delete_specialist_pool(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -712,9 +712,9 @@ async def update_specialist_pool( from google.cloud import aiplatform_v1 - def sample_update_specialist_pool(): + async def sample_update_specialist_pool(): # Create a client - client = aiplatform_v1.SpecialistPoolServiceClient() + client = aiplatform_v1.SpecialistPoolServiceAsyncClient() # Initialize request argument(s) specialist_pool = aiplatform_v1.SpecialistPool() @@ -730,7 +730,7 @@ def sample_update_specialist_pool(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) diff --git a/google/cloud/aiplatform_v1/services/tensorboard_service/async_client.py b/google/cloud/aiplatform_v1/services/tensorboard_service/async_client.py index 8e0d7b96fb..99de1b19c1 100644 --- a/google/cloud/aiplatform_v1/services/tensorboard_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/tensorboard_service/async_client.py @@ -267,9 +267,9 @@ async def create_tensorboard( from google.cloud import aiplatform_v1 - def sample_create_tensorboard(): + async def sample_create_tensorboard(): # Create a client - client = aiplatform_v1.TensorboardServiceClient() + client = aiplatform_v1.TensorboardServiceAsyncClient() # Initialize request argument(s) tensorboard = aiplatform_v1.Tensorboard() @@ -285,7 +285,7 @@ def sample_create_tensorboard(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -390,9 +390,9 @@ async def get_tensorboard( from google.cloud import aiplatform_v1 - def sample_get_tensorboard(): + async def sample_get_tensorboard(): # Create a client - client = aiplatform_v1.TensorboardServiceClient() + client = aiplatform_v1.TensorboardServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.GetTensorboardRequest( @@ -400,7 +400,7 @@ def sample_get_tensorboard(): ) # Make the request - response = client.get_tensorboard(request=request) + response = await client.get_tensorboard(request=request) # Handle the response print(response) @@ -490,9 +490,9 @@ async def update_tensorboard( from google.cloud import aiplatform_v1 - def sample_update_tensorboard(): + async def sample_update_tensorboard(): # Create a client - client = aiplatform_v1.TensorboardServiceClient() + client = aiplatform_v1.TensorboardServiceAsyncClient() # Initialize request argument(s) tensorboard = aiplatform_v1.Tensorboard() @@ -507,7 +507,7 @@ def sample_update_tensorboard(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -621,9 +621,9 @@ async def list_tensorboards( from google.cloud import aiplatform_v1 - def sample_list_tensorboards(): + async def sample_list_tensorboards(): # Create a client - client = aiplatform_v1.TensorboardServiceClient() + client = aiplatform_v1.TensorboardServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ListTensorboardsRequest( @@ -634,7 +634,7 @@ def sample_list_tensorboards(): page_result = client.list_tensorboards(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -730,9 +730,9 @@ async def delete_tensorboard( from google.cloud import aiplatform_v1 - def sample_delete_tensorboard(): + async def sample_delete_tensorboard(): # Create a client - client = aiplatform_v1.TensorboardServiceClient() + client = aiplatform_v1.TensorboardServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.DeleteTensorboardRequest( @@ -744,7 +744,7 @@ def sample_delete_tensorboard(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -855,9 +855,9 @@ async def create_tensorboard_experiment( from google.cloud import aiplatform_v1 - def sample_create_tensorboard_experiment(): + async def sample_create_tensorboard_experiment(): # Create a client - client = aiplatform_v1.TensorboardServiceClient() + client = aiplatform_v1.TensorboardServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.CreateTensorboardExperimentRequest( @@ -866,7 +866,7 @@ def sample_create_tensorboard_experiment(): ) # Make the request - response = client.create_tensorboard_experiment(request=request) + response = await client.create_tensorboard_experiment(request=request) # Handle the response print(response) @@ -978,9 +978,9 @@ async def get_tensorboard_experiment( from google.cloud import aiplatform_v1 - def sample_get_tensorboard_experiment(): + async def sample_get_tensorboard_experiment(): # Create a client - client = aiplatform_v1.TensorboardServiceClient() + client = aiplatform_v1.TensorboardServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.GetTensorboardExperimentRequest( @@ -988,7 +988,7 @@ def sample_get_tensorboard_experiment(): ) # Make the request - response = client.get_tensorboard_experiment(request=request) + response = await client.get_tensorboard_experiment(request=request) # Handle the response print(response) @@ -1079,16 +1079,16 @@ async def update_tensorboard_experiment( from google.cloud import aiplatform_v1 - def sample_update_tensorboard_experiment(): + async def sample_update_tensorboard_experiment(): # Create a client - client = aiplatform_v1.TensorboardServiceClient() + client = aiplatform_v1.TensorboardServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.UpdateTensorboardExperimentRequest( ) # Make the request - response = client.update_tensorboard_experiment(request=request) + response = await client.update_tensorboard_experiment(request=request) # Handle the response print(response) @@ -1195,9 +1195,9 @@ async def list_tensorboard_experiments( from google.cloud import aiplatform_v1 - def sample_list_tensorboard_experiments(): + async def sample_list_tensorboard_experiments(): # Create a client - client = aiplatform_v1.TensorboardServiceClient() + client = aiplatform_v1.TensorboardServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ListTensorboardExperimentsRequest( @@ -1208,7 +1208,7 @@ def sample_list_tensorboard_experiments(): page_result = client.list_tensorboard_experiments(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1307,9 +1307,9 @@ async def delete_tensorboard_experiment( from google.cloud import aiplatform_v1 - def sample_delete_tensorboard_experiment(): + async def sample_delete_tensorboard_experiment(): # Create a client - client = aiplatform_v1.TensorboardServiceClient() + client = aiplatform_v1.TensorboardServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.DeleteTensorboardExperimentRequest( @@ -1321,7 +1321,7 @@ def sample_delete_tensorboard_experiment(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1430,9 +1430,9 @@ async def create_tensorboard_run( from google.cloud import aiplatform_v1 - def sample_create_tensorboard_run(): + async def sample_create_tensorboard_run(): # Create a client - client = aiplatform_v1.TensorboardServiceClient() + client = aiplatform_v1.TensorboardServiceAsyncClient() # Initialize request argument(s) tensorboard_run = aiplatform_v1.TensorboardRun() @@ -1445,7 +1445,7 @@ def sample_create_tensorboard_run(): ) # Make the request - response = client.create_tensorboard_run(request=request) + response = await client.create_tensorboard_run(request=request) # Handle the response print(response) @@ -1558,9 +1558,9 @@ async def batch_create_tensorboard_runs( from google.cloud import aiplatform_v1 - def sample_batch_create_tensorboard_runs(): + async def sample_batch_create_tensorboard_runs(): # Create a client - client = aiplatform_v1.TensorboardServiceClient() + client = aiplatform_v1.TensorboardServiceAsyncClient() # Initialize request argument(s) requests = aiplatform_v1.CreateTensorboardRunRequest() @@ -1574,7 +1574,7 @@ def sample_batch_create_tensorboard_runs(): ) # Make the request - response = client.batch_create_tensorboard_runs(request=request) + response = await client.batch_create_tensorboard_runs(request=request) # Handle the response print(response) @@ -1674,9 +1674,9 @@ async def get_tensorboard_run( from google.cloud import aiplatform_v1 - def sample_get_tensorboard_run(): + async def sample_get_tensorboard_run(): # Create a client - client = aiplatform_v1.TensorboardServiceClient() + client = aiplatform_v1.TensorboardServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.GetTensorboardRunRequest( @@ -1684,7 +1684,7 @@ def sample_get_tensorboard_run(): ) # Make the request - response = client.get_tensorboard_run(request=request) + response = await client.get_tensorboard_run(request=request) # Handle the response print(response) @@ -1773,9 +1773,9 @@ async def update_tensorboard_run( from google.cloud import aiplatform_v1 - def sample_update_tensorboard_run(): + async def sample_update_tensorboard_run(): # Create a client - client = aiplatform_v1.TensorboardServiceClient() + client = aiplatform_v1.TensorboardServiceAsyncClient() # Initialize request argument(s) tensorboard_run = aiplatform_v1.TensorboardRun() @@ -1786,7 +1786,7 @@ def sample_update_tensorboard_run(): ) # Make the request - response = client.update_tensorboard_run(request=request) + response = await client.update_tensorboard_run(request=request) # Handle the response print(response) @@ -1890,9 +1890,9 @@ async def list_tensorboard_runs( from google.cloud import aiplatform_v1 - def sample_list_tensorboard_runs(): + async def sample_list_tensorboard_runs(): # Create a client - client = aiplatform_v1.TensorboardServiceClient() + client = aiplatform_v1.TensorboardServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ListTensorboardRunsRequest( @@ -1903,7 +1903,7 @@ def sample_list_tensorboard_runs(): page_result = client.list_tensorboard_runs(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -2000,9 +2000,9 @@ async def delete_tensorboard_run( from google.cloud import aiplatform_v1 - def sample_delete_tensorboard_run(): + async def sample_delete_tensorboard_run(): # Create a client - client = aiplatform_v1.TensorboardServiceClient() + client = aiplatform_v1.TensorboardServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.DeleteTensorboardRunRequest( @@ -2014,7 +2014,7 @@ def sample_delete_tensorboard_run(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -2127,9 +2127,9 @@ async def batch_create_tensorboard_time_series( from google.cloud import aiplatform_v1 - def sample_batch_create_tensorboard_time_series(): + async def sample_batch_create_tensorboard_time_series(): # Create a client - client = aiplatform_v1.TensorboardServiceClient() + client = aiplatform_v1.TensorboardServiceAsyncClient() # Initialize request argument(s) requests = aiplatform_v1.CreateTensorboardTimeSeriesRequest() @@ -2143,7 +2143,7 @@ def sample_batch_create_tensorboard_time_series(): ) # Make the request - response = client.batch_create_tensorboard_time_series(request=request) + response = await client.batch_create_tensorboard_time_series(request=request) # Handle the response print(response) @@ -2247,9 +2247,9 @@ async def create_tensorboard_time_series( from google.cloud import aiplatform_v1 - def sample_create_tensorboard_time_series(): + async def sample_create_tensorboard_time_series(): # Create a client - client = aiplatform_v1.TensorboardServiceClient() + client = aiplatform_v1.TensorboardServiceAsyncClient() # Initialize request argument(s) tensorboard_time_series = aiplatform_v1.TensorboardTimeSeries() @@ -2262,7 +2262,7 @@ def sample_create_tensorboard_time_series(): ) # Make the request - response = client.create_tensorboard_time_series(request=request) + response = await client.create_tensorboard_time_series(request=request) # Handle the response print(response) @@ -2359,9 +2359,9 @@ async def get_tensorboard_time_series( from google.cloud import aiplatform_v1 - def sample_get_tensorboard_time_series(): + async def sample_get_tensorboard_time_series(): # Create a client - client = aiplatform_v1.TensorboardServiceClient() + client = aiplatform_v1.TensorboardServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.GetTensorboardTimeSeriesRequest( @@ -2369,7 +2369,7 @@ def sample_get_tensorboard_time_series(): ) # Make the request - response = client.get_tensorboard_time_series(request=request) + response = await client.get_tensorboard_time_series(request=request) # Handle the response print(response) @@ -2458,9 +2458,9 @@ async def update_tensorboard_time_series( from google.cloud import aiplatform_v1 - def sample_update_tensorboard_time_series(): + async def sample_update_tensorboard_time_series(): # Create a client - client = aiplatform_v1.TensorboardServiceClient() + client = aiplatform_v1.TensorboardServiceAsyncClient() # Initialize request argument(s) tensorboard_time_series = aiplatform_v1.TensorboardTimeSeries() @@ -2472,7 +2472,7 @@ def sample_update_tensorboard_time_series(): ) # Make the request - response = client.update_tensorboard_time_series(request=request) + response = await client.update_tensorboard_time_series(request=request) # Handle the response print(response) @@ -2582,9 +2582,9 @@ async def list_tensorboard_time_series( from google.cloud import aiplatform_v1 - def sample_list_tensorboard_time_series(): + async def sample_list_tensorboard_time_series(): # Create a client - client = aiplatform_v1.TensorboardServiceClient() + client = aiplatform_v1.TensorboardServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ListTensorboardTimeSeriesRequest( @@ -2595,7 +2595,7 @@ def sample_list_tensorboard_time_series(): page_result = client.list_tensorboard_time_series(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -2694,9 +2694,9 @@ async def delete_tensorboard_time_series( from google.cloud import aiplatform_v1 - def sample_delete_tensorboard_time_series(): + async def sample_delete_tensorboard_time_series(): # Create a client - client = aiplatform_v1.TensorboardServiceClient() + client = aiplatform_v1.TensorboardServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.DeleteTensorboardTimeSeriesRequest( @@ -2708,7 +2708,7 @@ def sample_delete_tensorboard_time_series(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -2822,9 +2822,9 @@ async def batch_read_tensorboard_time_series_data( from google.cloud import aiplatform_v1 - def sample_batch_read_tensorboard_time_series_data(): + async def sample_batch_read_tensorboard_time_series_data(): # Create a client - client = aiplatform_v1.TensorboardServiceClient() + client = aiplatform_v1.TensorboardServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.BatchReadTensorboardTimeSeriesDataRequest( @@ -2833,7 +2833,7 @@ def sample_batch_read_tensorboard_time_series_data(): ) # Make the request - response = client.batch_read_tensorboard_time_series_data(request=request) + response = await client.batch_read_tensorboard_time_series_data(request=request) # Handle the response print(response) @@ -2931,9 +2931,9 @@ async def read_tensorboard_time_series_data( from google.cloud import aiplatform_v1 - def sample_read_tensorboard_time_series_data(): + async def sample_read_tensorboard_time_series_data(): # Create a client - client = aiplatform_v1.TensorboardServiceClient() + client = aiplatform_v1.TensorboardServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ReadTensorboardTimeSeriesDataRequest( @@ -2941,7 +2941,7 @@ def sample_read_tensorboard_time_series_data(): ) # Make the request - response = client.read_tensorboard_time_series_data(request=request) + response = await client.read_tensorboard_time_series_data(request=request) # Handle the response print(response) @@ -3032,9 +3032,9 @@ def read_tensorboard_blob_data( from google.cloud import aiplatform_v1 - def sample_read_tensorboard_blob_data(): + async def sample_read_tensorboard_blob_data(): # Create a client - client = aiplatform_v1.TensorboardServiceClient() + client = aiplatform_v1.TensorboardServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ReadTensorboardBlobDataRequest( @@ -3042,10 +3042,10 @@ def sample_read_tensorboard_blob_data(): ) # Make the request - stream = client.read_tensorboard_blob_data(request=request) + stream = await client.read_tensorboard_blob_data(request=request) # Handle the response - for response in stream: + async for response in stream: print(response) Args: @@ -3138,9 +3138,9 @@ async def write_tensorboard_experiment_data( from google.cloud import aiplatform_v1 - def sample_write_tensorboard_experiment_data(): + async def sample_write_tensorboard_experiment_data(): # Create a client - client = aiplatform_v1.TensorboardServiceClient() + client = aiplatform_v1.TensorboardServiceAsyncClient() # Initialize request argument(s) write_run_data_requests = aiplatform_v1.WriteTensorboardRunDataRequest() @@ -3154,7 +3154,7 @@ def sample_write_tensorboard_experiment_data(): ) # Make the request - response = client.write_tensorboard_experiment_data(request=request) + response = await client.write_tensorboard_experiment_data(request=request) # Handle the response print(response) @@ -3254,9 +3254,9 @@ async def write_tensorboard_run_data( from google.cloud import aiplatform_v1 - def sample_write_tensorboard_run_data(): + async def sample_write_tensorboard_run_data(): # Create a client - client = aiplatform_v1.TensorboardServiceClient() + client = aiplatform_v1.TensorboardServiceAsyncClient() # Initialize request argument(s) time_series_data = aiplatform_v1.TimeSeriesData() @@ -3269,7 +3269,7 @@ def sample_write_tensorboard_run_data(): ) # Make the request - response = client.write_tensorboard_run_data(request=request) + response = await client.write_tensorboard_run_data(request=request) # Handle the response print(response) @@ -3375,9 +3375,9 @@ async def export_tensorboard_time_series_data( from google.cloud import aiplatform_v1 - def sample_export_tensorboard_time_series_data(): + async def sample_export_tensorboard_time_series_data(): # Create a client - client = aiplatform_v1.TensorboardServiceClient() + client = aiplatform_v1.TensorboardServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ExportTensorboardTimeSeriesDataRequest( @@ -3388,7 +3388,7 @@ def sample_export_tensorboard_time_series_data(): page_result = client.export_tensorboard_time_series_data(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: diff --git a/google/cloud/aiplatform_v1/services/vizier_service/async_client.py b/google/cloud/aiplatform_v1/services/vizier_service/async_client.py index a6da2fcd73..42e93b994a 100644 --- a/google/cloud/aiplatform_v1/services/vizier_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/vizier_service/async_client.py @@ -232,9 +232,9 @@ async def create_study( from google.cloud import aiplatform_v1 - def sample_create_study(): + async def sample_create_study(): # Create a client - client = aiplatform_v1.VizierServiceClient() + client = aiplatform_v1.VizierServiceAsyncClient() # Initialize request argument(s) study = aiplatform_v1.Study() @@ -251,7 +251,7 @@ def sample_create_study(): ) # Make the request - response = client.create_study(request=request) + response = await client.create_study(request=request) # Handle the response print(response) @@ -344,9 +344,9 @@ async def get_study( from google.cloud import aiplatform_v1 - def sample_get_study(): + async def sample_get_study(): # Create a client - client = aiplatform_v1.VizierServiceClient() + client = aiplatform_v1.VizierServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.GetStudyRequest( @@ -354,7 +354,7 @@ def sample_get_study(): ) # Make the request - response = client.get_study(request=request) + response = await client.get_study(request=request) # Handle the response print(response) @@ -438,9 +438,9 @@ async def list_studies( from google.cloud import aiplatform_v1 - def sample_list_studies(): + async def sample_list_studies(): # Create a client - client = aiplatform_v1.VizierServiceClient() + client = aiplatform_v1.VizierServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ListStudiesRequest( @@ -451,7 +451,7 @@ def sample_list_studies(): page_result = client.list_studies(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -547,9 +547,9 @@ async def delete_study( from google.cloud import aiplatform_v1 - def sample_delete_study(): + async def sample_delete_study(): # Create a client - client = aiplatform_v1.VizierServiceClient() + client = aiplatform_v1.VizierServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.DeleteStudyRequest( @@ -557,7 +557,7 @@ def sample_delete_study(): ) # Make the request - client.delete_study(request=request) + await client.delete_study(request=request) Args: request (Union[google.cloud.aiplatform_v1.types.DeleteStudyRequest, dict]): @@ -632,9 +632,9 @@ async def lookup_study( from google.cloud import aiplatform_v1 - def sample_lookup_study(): + async def sample_lookup_study(): # Create a client - client = aiplatform_v1.VizierServiceClient() + client = aiplatform_v1.VizierServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.LookupStudyRequest( @@ -643,7 +643,7 @@ def sample_lookup_study(): ) # Make the request - response = client.lookup_study(request=request) + response = await client.lookup_study(request=request) # Handle the response print(response) @@ -730,9 +730,9 @@ async def suggest_trials( from google.cloud import aiplatform_v1 - def sample_suggest_trials(): + async def sample_suggest_trials(): # Create a client - client = aiplatform_v1.VizierServiceClient() + client = aiplatform_v1.VizierServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.SuggestTrialsRequest( @@ -746,7 +746,7 @@ def sample_suggest_trials(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -823,9 +823,9 @@ async def create_trial( from google.cloud import aiplatform_v1 - def sample_create_trial(): + async def sample_create_trial(): # Create a client - client = aiplatform_v1.VizierServiceClient() + client = aiplatform_v1.VizierServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.CreateTrialRequest( @@ -833,7 +833,7 @@ def sample_create_trial(): ) # Make the request - response = client.create_trial(request=request) + response = await client.create_trial(request=request) # Handle the response print(response) @@ -929,9 +929,9 @@ async def get_trial( from google.cloud import aiplatform_v1 - def sample_get_trial(): + async def sample_get_trial(): # Create a client - client = aiplatform_v1.VizierServiceClient() + client = aiplatform_v1.VizierServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.GetTrialRequest( @@ -939,7 +939,7 @@ def sample_get_trial(): ) # Make the request - response = client.get_trial(request=request) + response = await client.get_trial(request=request) # Handle the response print(response) @@ -1027,9 +1027,9 @@ async def list_trials( from google.cloud import aiplatform_v1 - def sample_list_trials(): + async def sample_list_trials(): # Create a client - client = aiplatform_v1.VizierServiceClient() + client = aiplatform_v1.VizierServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ListTrialsRequest( @@ -1040,7 +1040,7 @@ def sample_list_trials(): page_result = client.list_trials(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1137,9 +1137,9 @@ async def add_trial_measurement( from google.cloud import aiplatform_v1 - def sample_add_trial_measurement(): + async def sample_add_trial_measurement(): # Create a client - client = aiplatform_v1.VizierServiceClient() + client = aiplatform_v1.VizierServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.AddTrialMeasurementRequest( @@ -1147,7 +1147,7 @@ def sample_add_trial_measurement(): ) # Make the request - response = client.add_trial_measurement(request=request) + response = await client.add_trial_measurement(request=request) # Handle the response print(response) @@ -1215,9 +1215,9 @@ async def complete_trial( from google.cloud import aiplatform_v1 - def sample_complete_trial(): + async def sample_complete_trial(): # Create a client - client = aiplatform_v1.VizierServiceClient() + client = aiplatform_v1.VizierServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.CompleteTrialRequest( @@ -1225,7 +1225,7 @@ def sample_complete_trial(): ) # Make the request - response = client.complete_trial(request=request) + response = await client.complete_trial(request=request) # Handle the response print(response) @@ -1292,9 +1292,9 @@ async def delete_trial( from google.cloud import aiplatform_v1 - def sample_delete_trial(): + async def sample_delete_trial(): # Create a client - client = aiplatform_v1.VizierServiceClient() + client = aiplatform_v1.VizierServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.DeleteTrialRequest( @@ -1302,7 +1302,7 @@ def sample_delete_trial(): ) # Make the request - client.delete_trial(request=request) + await client.delete_trial(request=request) Args: request (Union[google.cloud.aiplatform_v1.types.DeleteTrialRequest, dict]): @@ -1377,9 +1377,9 @@ async def check_trial_early_stopping_state( from google.cloud import aiplatform_v1 - def sample_check_trial_early_stopping_state(): + async def sample_check_trial_early_stopping_state(): # Create a client - client = aiplatform_v1.VizierServiceClient() + client = aiplatform_v1.VizierServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.CheckTrialEarlyStoppingStateRequest( @@ -1391,7 +1391,7 @@ def sample_check_trial_early_stopping_state(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1468,9 +1468,9 @@ async def stop_trial( from google.cloud import aiplatform_v1 - def sample_stop_trial(): + async def sample_stop_trial(): # Create a client - client = aiplatform_v1.VizierServiceClient() + client = aiplatform_v1.VizierServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.StopTrialRequest( @@ -1478,7 +1478,7 @@ def sample_stop_trial(): ) # Make the request - response = client.stop_trial(request=request) + response = await client.stop_trial(request=request) # Handle the response print(response) @@ -1548,9 +1548,9 @@ async def list_optimal_trials( from google.cloud import aiplatform_v1 - def sample_list_optimal_trials(): + async def sample_list_optimal_trials(): # Create a client - client = aiplatform_v1.VizierServiceClient() + client = aiplatform_v1.VizierServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ListOptimalTrialsRequest( @@ -1558,7 +1558,7 @@ def sample_list_optimal_trials(): ) # Make the request - response = client.list_optimal_trials(request=request) + response = await client.list_optimal_trials(request=request) # Handle the response print(response) diff --git a/google/cloud/aiplatform_v1beta1/__init__.py b/google/cloud/aiplatform_v1beta1/__init__.py index 6bf3428e83..b04a7bcd87 100644 --- a/google/cloud/aiplatform_v1beta1/__init__.py +++ b/google/cloud/aiplatform_v1beta1/__init__.py @@ -371,6 +371,7 @@ from .types.pipeline_job import PipelineJobDetail from .types.pipeline_job import PipelineTaskDetail from .types.pipeline_job import PipelineTaskExecutorDetail +from .types.pipeline_job import PipelineTemplateMetadata from .types.pipeline_service import CancelPipelineJobRequest from .types.pipeline_service import CancelTrainingPipelineRequest from .types.pipeline_service import CreatePipelineJobRequest @@ -845,6 +846,7 @@ "PipelineState", "PipelineTaskDetail", "PipelineTaskExecutorDetail", + "PipelineTemplateMetadata", "Port", "PredefinedSplit", "PredictRequest", diff --git a/google/cloud/aiplatform_v1beta1/services/dataset_service/async_client.py b/google/cloud/aiplatform_v1beta1/services/dataset_service/async_client.py index 4091a72cf2..750506febb 100644 --- a/google/cloud/aiplatform_v1beta1/services/dataset_service/async_client.py +++ b/google/cloud/aiplatform_v1beta1/services/dataset_service/async_client.py @@ -241,9 +241,9 @@ async def create_dataset( from google.cloud import aiplatform_v1beta1 - def sample_create_dataset(): + async def sample_create_dataset(): # Create a client - client = aiplatform_v1beta1.DatasetServiceClient() + client = aiplatform_v1beta1.DatasetServiceAsyncClient() # Initialize request argument(s) dataset = aiplatform_v1beta1.Dataset() @@ -261,7 +261,7 @@ def sample_create_dataset(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -365,9 +365,9 @@ async def get_dataset( from google.cloud import aiplatform_v1beta1 - def sample_get_dataset(): + async def sample_get_dataset(): # Create a client - client = aiplatform_v1beta1.DatasetServiceClient() + client = aiplatform_v1beta1.DatasetServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.GetDatasetRequest( @@ -375,7 +375,7 @@ def sample_get_dataset(): ) # Make the request - response = client.get_dataset(request=request) + response = await client.get_dataset(request=request) # Handle the response print(response) @@ -461,9 +461,9 @@ async def update_dataset( from google.cloud import aiplatform_v1beta1 - def sample_update_dataset(): + async def sample_update_dataset(): # Create a client - client = aiplatform_v1beta1.DatasetServiceClient() + client = aiplatform_v1beta1.DatasetServiceAsyncClient() # Initialize request argument(s) dataset = aiplatform_v1beta1.Dataset() @@ -476,7 +476,7 @@ def sample_update_dataset(): ) # Make the request - response = client.update_dataset(request=request) + response = await client.update_dataset(request=request) # Handle the response print(response) @@ -578,9 +578,9 @@ async def list_datasets( from google.cloud import aiplatform_v1beta1 - def sample_list_datasets(): + async def sample_list_datasets(): # Create a client - client = aiplatform_v1beta1.DatasetServiceClient() + client = aiplatform_v1beta1.DatasetServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.ListDatasetsRequest( @@ -591,7 +591,7 @@ def sample_list_datasets(): page_result = client.list_datasets(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -686,9 +686,9 @@ async def delete_dataset( from google.cloud import aiplatform_v1beta1 - def sample_delete_dataset(): + async def sample_delete_dataset(): # Create a client - client = aiplatform_v1beta1.DatasetServiceClient() + client = aiplatform_v1beta1.DatasetServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.DeleteDatasetRequest( @@ -700,7 +700,7 @@ def sample_delete_dataset(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -808,9 +808,9 @@ async def import_data( from google.cloud import aiplatform_v1beta1 - def sample_import_data(): + async def sample_import_data(): # Create a client - client = aiplatform_v1beta1.DatasetServiceClient() + client = aiplatform_v1beta1.DatasetServiceAsyncClient() # Initialize request argument(s) import_configs = aiplatform_v1beta1.ImportDataConfig() @@ -827,7 +827,7 @@ def sample_import_data(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -935,9 +935,9 @@ async def export_data( from google.cloud import aiplatform_v1beta1 - def sample_export_data(): + async def sample_export_data(): # Create a client - client = aiplatform_v1beta1.DatasetServiceClient() + client = aiplatform_v1beta1.DatasetServiceAsyncClient() # Initialize request argument(s) export_config = aiplatform_v1beta1.ExportDataConfig() @@ -953,7 +953,7 @@ def sample_export_data(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1059,9 +1059,9 @@ async def list_data_items( from google.cloud import aiplatform_v1beta1 - def sample_list_data_items(): + async def sample_list_data_items(): # Create a client - client = aiplatform_v1beta1.DatasetServiceClient() + client = aiplatform_v1beta1.DatasetServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.ListDataItemsRequest( @@ -1072,7 +1072,7 @@ def sample_list_data_items(): page_result = client.list_data_items(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1168,9 +1168,9 @@ async def get_annotation_spec( from google.cloud import aiplatform_v1beta1 - def sample_get_annotation_spec(): + async def sample_get_annotation_spec(): # Create a client - client = aiplatform_v1beta1.DatasetServiceClient() + client = aiplatform_v1beta1.DatasetServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.GetAnnotationSpecRequest( @@ -1178,7 +1178,7 @@ def sample_get_annotation_spec(): ) # Make the request - response = client.get_annotation_spec(request=request) + response = await client.get_annotation_spec(request=request) # Handle the response print(response) @@ -1264,9 +1264,9 @@ async def list_annotations( from google.cloud import aiplatform_v1beta1 - def sample_list_annotations(): + async def sample_list_annotations(): # Create a client - client = aiplatform_v1beta1.DatasetServiceClient() + client = aiplatform_v1beta1.DatasetServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.ListAnnotationsRequest( @@ -1277,7 +1277,7 @@ def sample_list_annotations(): page_result = client.list_annotations(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: diff --git a/google/cloud/aiplatform_v1beta1/services/endpoint_service/async_client.py b/google/cloud/aiplatform_v1beta1/services/endpoint_service/async_client.py index 3b939e5c71..9df0e2dbb0 100644 --- a/google/cloud/aiplatform_v1beta1/services/endpoint_service/async_client.py +++ b/google/cloud/aiplatform_v1beta1/services/endpoint_service/async_client.py @@ -238,9 +238,9 @@ async def create_endpoint( from google.cloud import aiplatform_v1beta1 - def sample_create_endpoint(): + async def sample_create_endpoint(): # Create a client - client = aiplatform_v1beta1.EndpointServiceClient() + client = aiplatform_v1beta1.EndpointServiceAsyncClient() # Initialize request argument(s) endpoint = aiplatform_v1beta1.Endpoint() @@ -256,7 +256,7 @@ def sample_create_endpoint(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -376,9 +376,9 @@ async def get_endpoint( from google.cloud import aiplatform_v1beta1 - def sample_get_endpoint(): + async def sample_get_endpoint(): # Create a client - client = aiplatform_v1beta1.EndpointServiceClient() + client = aiplatform_v1beta1.EndpointServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.GetEndpointRequest( @@ -386,7 +386,7 @@ def sample_get_endpoint(): ) # Make the request - response = client.get_endpoint(request=request) + response = await client.get_endpoint(request=request) # Handle the response print(response) @@ -472,9 +472,9 @@ async def list_endpoints( from google.cloud import aiplatform_v1beta1 - def sample_list_endpoints(): + async def sample_list_endpoints(): # Create a client - client = aiplatform_v1beta1.EndpointServiceClient() + client = aiplatform_v1beta1.EndpointServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.ListEndpointsRequest( @@ -485,7 +485,7 @@ def sample_list_endpoints(): page_result = client.list_endpoints(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -582,9 +582,9 @@ async def update_endpoint( from google.cloud import aiplatform_v1beta1 - def sample_update_endpoint(): + async def sample_update_endpoint(): # Create a client - client = aiplatform_v1beta1.EndpointServiceClient() + client = aiplatform_v1beta1.EndpointServiceAsyncClient() # Initialize request argument(s) endpoint = aiplatform_v1beta1.Endpoint() @@ -595,7 +595,7 @@ def sample_update_endpoint(): ) # Make the request - response = client.update_endpoint(request=request) + response = await client.update_endpoint(request=request) # Handle the response print(response) @@ -692,9 +692,9 @@ async def delete_endpoint( from google.cloud import aiplatform_v1beta1 - def sample_delete_endpoint(): + async def sample_delete_endpoint(): # Create a client - client = aiplatform_v1beta1.EndpointServiceClient() + client = aiplatform_v1beta1.EndpointServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.DeleteEndpointRequest( @@ -706,7 +706,7 @@ def sample_delete_endpoint(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -816,9 +816,9 @@ async def deploy_model( from google.cloud import aiplatform_v1beta1 - def sample_deploy_model(): + async def sample_deploy_model(): # Create a client - client = aiplatform_v1beta1.EndpointServiceClient() + client = aiplatform_v1beta1.EndpointServiceAsyncClient() # Initialize request argument(s) deployed_model = aiplatform_v1beta1.DeployedModel() @@ -835,7 +835,7 @@ def sample_deploy_model(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -973,9 +973,9 @@ async def undeploy_model( from google.cloud import aiplatform_v1beta1 - def sample_undeploy_model(): + async def sample_undeploy_model(): # Create a client - client = aiplatform_v1beta1.EndpointServiceClient() + client = aiplatform_v1beta1.EndpointServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.UndeployModelRequest( @@ -988,7 +988,7 @@ def sample_undeploy_model(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) diff --git a/google/cloud/aiplatform_v1beta1/services/featurestore_online_serving_service/async_client.py b/google/cloud/aiplatform_v1beta1/services/featurestore_online_serving_service/async_client.py index 6133afe135..f480e3681d 100644 --- a/google/cloud/aiplatform_v1beta1/services/featurestore_online_serving_service/async_client.py +++ b/google/cloud/aiplatform_v1beta1/services/featurestore_online_serving_service/async_client.py @@ -249,9 +249,9 @@ async def read_feature_values( from google.cloud import aiplatform_v1beta1 - def sample_read_feature_values(): + async def sample_read_feature_values(): # Create a client - client = aiplatform_v1beta1.FeaturestoreOnlineServingServiceClient() + client = aiplatform_v1beta1.FeaturestoreOnlineServingServiceAsyncClient() # Initialize request argument(s) feature_selector = aiplatform_v1beta1.FeatureSelector() @@ -264,7 +264,7 @@ def sample_read_feature_values(): ) # Make the request - response = client.read_feature_values(request=request) + response = await client.read_feature_values(request=request) # Handle the response print(response) @@ -361,9 +361,9 @@ def streaming_read_feature_values( from google.cloud import aiplatform_v1beta1 - def sample_streaming_read_feature_values(): + async def sample_streaming_read_feature_values(): # Create a client - client = aiplatform_v1beta1.FeaturestoreOnlineServingServiceClient() + client = aiplatform_v1beta1.FeaturestoreOnlineServingServiceAsyncClient() # Initialize request argument(s) feature_selector = aiplatform_v1beta1.FeatureSelector() @@ -376,10 +376,10 @@ def sample_streaming_read_feature_values(): ) # Make the request - stream = client.streaming_read_feature_values(request=request) + stream = await client.streaming_read_feature_values(request=request) # Handle the response - for response in stream: + async for response in stream: print(response) Args: diff --git a/google/cloud/aiplatform_v1beta1/services/featurestore_service/async_client.py b/google/cloud/aiplatform_v1beta1/services/featurestore_service/async_client.py index eb1537cec1..965c4e1f4c 100644 --- a/google/cloud/aiplatform_v1beta1/services/featurestore_service/async_client.py +++ b/google/cloud/aiplatform_v1beta1/services/featurestore_service/async_client.py @@ -246,9 +246,9 @@ async def create_featurestore( from google.cloud import aiplatform_v1beta1 - def sample_create_featurestore(): + async def sample_create_featurestore(): # Create a client - client = aiplatform_v1beta1.FeaturestoreServiceClient() + client = aiplatform_v1beta1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.CreateFeaturestoreRequest( @@ -261,7 +261,7 @@ def sample_create_featurestore(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -383,9 +383,9 @@ async def get_featurestore( from google.cloud import aiplatform_v1beta1 - def sample_get_featurestore(): + async def sample_get_featurestore(): # Create a client - client = aiplatform_v1beta1.FeaturestoreServiceClient() + client = aiplatform_v1beta1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.GetFeaturestoreRequest( @@ -393,7 +393,7 @@ def sample_get_featurestore(): ) # Make the request - response = client.get_featurestore(request=request) + response = await client.get_featurestore(request=request) # Handle the response print(response) @@ -481,9 +481,9 @@ async def list_featurestores( from google.cloud import aiplatform_v1beta1 - def sample_list_featurestores(): + async def sample_list_featurestores(): # Create a client - client = aiplatform_v1beta1.FeaturestoreServiceClient() + client = aiplatform_v1beta1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.ListFeaturestoresRequest( @@ -494,7 +494,7 @@ def sample_list_featurestores(): page_result = client.list_featurestores(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -591,9 +591,9 @@ async def update_featurestore( from google.cloud import aiplatform_v1beta1 - def sample_update_featurestore(): + async def sample_update_featurestore(): # Create a client - client = aiplatform_v1beta1.FeaturestoreServiceClient() + client = aiplatform_v1beta1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.UpdateFeaturestoreRequest( @@ -604,7 +604,7 @@ def sample_update_featurestore(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -727,9 +727,9 @@ async def delete_featurestore( from google.cloud import aiplatform_v1beta1 - def sample_delete_featurestore(): + async def sample_delete_featurestore(): # Create a client - client = aiplatform_v1beta1.FeaturestoreServiceClient() + client = aiplatform_v1beta1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.DeleteFeaturestoreRequest( @@ -741,7 +741,7 @@ def sample_delete_featurestore(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -862,9 +862,9 @@ async def create_entity_type( from google.cloud import aiplatform_v1beta1 - def sample_create_entity_type(): + async def sample_create_entity_type(): # Create a client - client = aiplatform_v1beta1.FeaturestoreServiceClient() + client = aiplatform_v1beta1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.CreateEntityTypeRequest( @@ -877,7 +877,7 @@ def sample_create_entity_type(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -998,9 +998,9 @@ async def get_entity_type( from google.cloud import aiplatform_v1beta1 - def sample_get_entity_type(): + async def sample_get_entity_type(): # Create a client - client = aiplatform_v1beta1.FeaturestoreServiceClient() + client = aiplatform_v1beta1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.GetEntityTypeRequest( @@ -1008,7 +1008,7 @@ def sample_get_entity_type(): ) # Make the request - response = client.get_entity_type(request=request) + response = await client.get_entity_type(request=request) # Handle the response print(response) @@ -1097,9 +1097,9 @@ async def list_entity_types( from google.cloud import aiplatform_v1beta1 - def sample_list_entity_types(): + async def sample_list_entity_types(): # Create a client - client = aiplatform_v1beta1.FeaturestoreServiceClient() + client = aiplatform_v1beta1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.ListEntityTypesRequest( @@ -1110,7 +1110,7 @@ def sample_list_entity_types(): page_result = client.list_entity_types(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1207,16 +1207,16 @@ async def update_entity_type( from google.cloud import aiplatform_v1beta1 - def sample_update_entity_type(): + async def sample_update_entity_type(): # Create a client - client = aiplatform_v1beta1.FeaturestoreServiceClient() + client = aiplatform_v1beta1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.UpdateEntityTypeRequest( ) # Make the request - response = client.update_entity_type(request=request) + response = await client.update_entity_type(request=request) # Handle the response print(response) @@ -1338,9 +1338,9 @@ async def delete_entity_type( from google.cloud import aiplatform_v1beta1 - def sample_delete_entity_type(): + async def sample_delete_entity_type(): # Create a client - client = aiplatform_v1beta1.FeaturestoreServiceClient() + client = aiplatform_v1beta1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.DeleteEntityTypeRequest( @@ -1352,7 +1352,7 @@ def sample_delete_entity_type(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1472,9 +1472,9 @@ async def create_feature( from google.cloud import aiplatform_v1beta1 - def sample_create_feature(): + async def sample_create_feature(): # Create a client - client = aiplatform_v1beta1.FeaturestoreServiceClient() + client = aiplatform_v1beta1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) feature = aiplatform_v1beta1.Feature() @@ -1491,7 +1491,7 @@ def sample_create_feature(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1612,9 +1612,9 @@ async def batch_create_features( from google.cloud import aiplatform_v1beta1 - def sample_batch_create_features(): + async def sample_batch_create_features(): # Create a client - client = aiplatform_v1beta1.FeaturestoreServiceClient() + client = aiplatform_v1beta1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) requests = aiplatform_v1beta1.CreateFeatureRequest() @@ -1632,7 +1632,7 @@ def sample_batch_create_features(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1743,9 +1743,9 @@ async def get_feature( from google.cloud import aiplatform_v1beta1 - def sample_get_feature(): + async def sample_get_feature(): # Create a client - client = aiplatform_v1beta1.FeaturestoreServiceClient() + client = aiplatform_v1beta1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.GetFeatureRequest( @@ -1753,7 +1753,7 @@ def sample_get_feature(): ) # Make the request - response = client.get_feature(request=request) + response = await client.get_feature(request=request) # Handle the response print(response) @@ -1841,9 +1841,9 @@ async def list_features( from google.cloud import aiplatform_v1beta1 - def sample_list_features(): + async def sample_list_features(): # Create a client - client = aiplatform_v1beta1.FeaturestoreServiceClient() + client = aiplatform_v1beta1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.ListFeaturesRequest( @@ -1854,7 +1854,7 @@ def sample_list_features(): page_result = client.list_features(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1951,9 +1951,9 @@ async def update_feature( from google.cloud import aiplatform_v1beta1 - def sample_update_feature(): + async def sample_update_feature(): # Create a client - client = aiplatform_v1beta1.FeaturestoreServiceClient() + client = aiplatform_v1beta1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) feature = aiplatform_v1beta1.Feature() @@ -1964,7 +1964,7 @@ def sample_update_feature(): ) # Make the request - response = client.update_feature(request=request) + response = await client.update_feature(request=request) # Handle the response print(response) @@ -2076,9 +2076,9 @@ async def delete_feature( from google.cloud import aiplatform_v1beta1 - def sample_delete_feature(): + async def sample_delete_feature(): # Create a client - client = aiplatform_v1beta1.FeaturestoreServiceClient() + client = aiplatform_v1beta1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.DeleteFeatureRequest( @@ -2090,7 +2090,7 @@ def sample_delete_feature(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -2217,9 +2217,9 @@ async def import_feature_values( from google.cloud import aiplatform_v1beta1 - def sample_import_feature_values(): + async def sample_import_feature_values(): # Create a client - client = aiplatform_v1beta1.FeaturestoreServiceClient() + client = aiplatform_v1beta1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) avro_source = aiplatform_v1beta1.AvroSource() @@ -2240,7 +2240,7 @@ def sample_import_feature_values(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -2346,9 +2346,9 @@ async def batch_read_feature_values( from google.cloud import aiplatform_v1beta1 - def sample_batch_read_feature_values(): + async def sample_batch_read_feature_values(): # Create a client - client = aiplatform_v1beta1.FeaturestoreServiceClient() + client = aiplatform_v1beta1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) csv_read_instances = aiplatform_v1beta1.CsvSource() @@ -2373,7 +2373,7 @@ def sample_batch_read_feature_values(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -2474,9 +2474,9 @@ async def export_feature_values( from google.cloud import aiplatform_v1beta1 - def sample_export_feature_values(): + async def sample_export_feature_values(): # Create a client - client = aiplatform_v1beta1.FeaturestoreServiceClient() + client = aiplatform_v1beta1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) destination = aiplatform_v1beta1.FeatureValueDestination() @@ -2496,7 +2496,7 @@ def sample_export_feature_values(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -2598,9 +2598,9 @@ async def search_features( from google.cloud import aiplatform_v1beta1 - def sample_search_features(): + async def sample_search_features(): # Create a client - client = aiplatform_v1beta1.FeaturestoreServiceClient() + client = aiplatform_v1beta1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.SearchFeaturesRequest( @@ -2611,7 +2611,7 @@ def sample_search_features(): page_result = client.search_features(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: diff --git a/google/cloud/aiplatform_v1beta1/services/index_endpoint_service/async_client.py b/google/cloud/aiplatform_v1beta1/services/index_endpoint_service/async_client.py index 14e2977345..0722b9e14c 100644 --- a/google/cloud/aiplatform_v1beta1/services/index_endpoint_service/async_client.py +++ b/google/cloud/aiplatform_v1beta1/services/index_endpoint_service/async_client.py @@ -231,9 +231,9 @@ async def create_index_endpoint( from google.cloud import aiplatform_v1beta1 - def sample_create_index_endpoint(): + async def sample_create_index_endpoint(): # Create a client - client = aiplatform_v1beta1.IndexEndpointServiceClient() + client = aiplatform_v1beta1.IndexEndpointServiceAsyncClient() # Initialize request argument(s) index_endpoint = aiplatform_v1beta1.IndexEndpoint() @@ -249,7 +249,7 @@ def sample_create_index_endpoint(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -354,9 +354,9 @@ async def get_index_endpoint( from google.cloud import aiplatform_v1beta1 - def sample_get_index_endpoint(): + async def sample_get_index_endpoint(): # Create a client - client = aiplatform_v1beta1.IndexEndpointServiceClient() + client = aiplatform_v1beta1.IndexEndpointServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.GetIndexEndpointRequest( @@ -364,7 +364,7 @@ def sample_get_index_endpoint(): ) # Make the request - response = client.get_index_endpoint(request=request) + response = await client.get_index_endpoint(request=request) # Handle the response print(response) @@ -451,9 +451,9 @@ async def list_index_endpoints( from google.cloud import aiplatform_v1beta1 - def sample_list_index_endpoints(): + async def sample_list_index_endpoints(): # Create a client - client = aiplatform_v1beta1.IndexEndpointServiceClient() + client = aiplatform_v1beta1.IndexEndpointServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.ListIndexEndpointsRequest( @@ -464,7 +464,7 @@ def sample_list_index_endpoints(): page_result = client.list_index_endpoints(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -561,9 +561,9 @@ async def update_index_endpoint( from google.cloud import aiplatform_v1beta1 - def sample_update_index_endpoint(): + async def sample_update_index_endpoint(): # Create a client - client = aiplatform_v1beta1.IndexEndpointServiceClient() + client = aiplatform_v1beta1.IndexEndpointServiceAsyncClient() # Initialize request argument(s) index_endpoint = aiplatform_v1beta1.IndexEndpoint() @@ -574,7 +574,7 @@ def sample_update_index_endpoint(): ) # Make the request - response = client.update_index_endpoint(request=request) + response = await client.update_index_endpoint(request=request) # Handle the response print(response) @@ -671,9 +671,9 @@ async def delete_index_endpoint( from google.cloud import aiplatform_v1beta1 - def sample_delete_index_endpoint(): + async def sample_delete_index_endpoint(): # Create a client - client = aiplatform_v1beta1.IndexEndpointServiceClient() + client = aiplatform_v1beta1.IndexEndpointServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.DeleteIndexEndpointRequest( @@ -685,7 +685,7 @@ def sample_delete_index_endpoint(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -795,9 +795,9 @@ async def deploy_index( from google.cloud import aiplatform_v1beta1 - def sample_deploy_index(): + async def sample_deploy_index(): # Create a client - client = aiplatform_v1beta1.IndexEndpointServiceClient() + client = aiplatform_v1beta1.IndexEndpointServiceAsyncClient() # Initialize request argument(s) deployed_index = aiplatform_v1beta1.DeployedIndex() @@ -814,7 +814,7 @@ def sample_deploy_index(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -926,9 +926,9 @@ async def undeploy_index( from google.cloud import aiplatform_v1beta1 - def sample_undeploy_index(): + async def sample_undeploy_index(): # Create a client - client = aiplatform_v1beta1.IndexEndpointServiceClient() + client = aiplatform_v1beta1.IndexEndpointServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.UndeployIndexRequest( @@ -941,7 +941,7 @@ def sample_undeploy_index(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1052,9 +1052,9 @@ async def mutate_deployed_index( from google.cloud import aiplatform_v1beta1 - def sample_mutate_deployed_index(): + async def sample_mutate_deployed_index(): # Create a client - client = aiplatform_v1beta1.IndexEndpointServiceClient() + client = aiplatform_v1beta1.IndexEndpointServiceAsyncClient() # Initialize request argument(s) deployed_index = aiplatform_v1beta1.DeployedIndex() @@ -1071,7 +1071,7 @@ def sample_mutate_deployed_index(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) diff --git a/google/cloud/aiplatform_v1beta1/services/index_service/async_client.py b/google/cloud/aiplatform_v1beta1/services/index_service/async_client.py index 77c1d8695e..f9dc9b8223 100644 --- a/google/cloud/aiplatform_v1beta1/services/index_service/async_client.py +++ b/google/cloud/aiplatform_v1beta1/services/index_service/async_client.py @@ -230,9 +230,9 @@ async def create_index( from google.cloud import aiplatform_v1beta1 - def sample_create_index(): + async def sample_create_index(): # Create a client - client = aiplatform_v1beta1.IndexServiceClient() + client = aiplatform_v1beta1.IndexServiceAsyncClient() # Initialize request argument(s) index = aiplatform_v1beta1.Index() @@ -248,7 +248,7 @@ def sample_create_index(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -352,9 +352,9 @@ async def get_index( from google.cloud import aiplatform_v1beta1 - def sample_get_index(): + async def sample_get_index(): # Create a client - client = aiplatform_v1beta1.IndexServiceClient() + client = aiplatform_v1beta1.IndexServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.GetIndexRequest( @@ -362,7 +362,7 @@ def sample_get_index(): ) # Make the request - response = client.get_index(request=request) + response = await client.get_index(request=request) # Handle the response print(response) @@ -449,9 +449,9 @@ async def list_indexes( from google.cloud import aiplatform_v1beta1 - def sample_list_indexes(): + async def sample_list_indexes(): # Create a client - client = aiplatform_v1beta1.IndexServiceClient() + client = aiplatform_v1beta1.IndexServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.ListIndexesRequest( @@ -462,7 +462,7 @@ def sample_list_indexes(): page_result = client.list_indexes(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -559,9 +559,9 @@ async def update_index( from google.cloud import aiplatform_v1beta1 - def sample_update_index(): + async def sample_update_index(): # Create a client - client = aiplatform_v1beta1.IndexServiceClient() + client = aiplatform_v1beta1.IndexServiceAsyncClient() # Initialize request argument(s) index = aiplatform_v1beta1.Index() @@ -576,7 +576,7 @@ def sample_update_index(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -686,9 +686,9 @@ async def delete_index( from google.cloud import aiplatform_v1beta1 - def sample_delete_index(): + async def sample_delete_index(): # Create a client - client = aiplatform_v1beta1.IndexServiceClient() + client = aiplatform_v1beta1.IndexServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.DeleteIndexRequest( @@ -700,7 +700,7 @@ def sample_delete_index(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) diff --git a/google/cloud/aiplatform_v1beta1/services/job_service/async_client.py b/google/cloud/aiplatform_v1beta1/services/job_service/async_client.py index ecc727ee93..b6a202cfc9 100644 --- a/google/cloud/aiplatform_v1beta1/services/job_service/async_client.py +++ b/google/cloud/aiplatform_v1beta1/services/job_service/async_client.py @@ -283,9 +283,9 @@ async def create_custom_job( from google.cloud import aiplatform_v1beta1 - def sample_create_custom_job(): + async def sample_create_custom_job(): # Create a client - client = aiplatform_v1beta1.JobServiceClient() + client = aiplatform_v1beta1.JobServiceAsyncClient() # Initialize request argument(s) custom_job = aiplatform_v1beta1.CustomJob() @@ -298,7 +298,7 @@ def sample_create_custom_job(): ) # Make the request - response = client.create_custom_job(request=request) + response = await client.create_custom_job(request=request) # Handle the response print(response) @@ -397,9 +397,9 @@ async def get_custom_job( from google.cloud import aiplatform_v1beta1 - def sample_get_custom_job(): + async def sample_get_custom_job(): # Create a client - client = aiplatform_v1beta1.JobServiceClient() + client = aiplatform_v1beta1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.GetCustomJobRequest( @@ -407,7 +407,7 @@ def sample_get_custom_job(): ) # Make the request - response = client.get_custom_job(request=request) + response = await client.get_custom_job(request=request) # Handle the response print(response) @@ -498,9 +498,9 @@ async def list_custom_jobs( from google.cloud import aiplatform_v1beta1 - def sample_list_custom_jobs(): + async def sample_list_custom_jobs(): # Create a client - client = aiplatform_v1beta1.JobServiceClient() + client = aiplatform_v1beta1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.ListCustomJobsRequest( @@ -511,7 +511,7 @@ def sample_list_custom_jobs(): page_result = client.list_custom_jobs(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -607,9 +607,9 @@ async def delete_custom_job( from google.cloud import aiplatform_v1beta1 - def sample_delete_custom_job(): + async def sample_delete_custom_job(): # Create a client - client = aiplatform_v1beta1.JobServiceClient() + client = aiplatform_v1beta1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.DeleteCustomJobRequest( @@ -621,7 +621,7 @@ def sample_delete_custom_job(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -740,9 +740,9 @@ async def cancel_custom_job( from google.cloud import aiplatform_v1beta1 - def sample_cancel_custom_job(): + async def sample_cancel_custom_job(): # Create a client - client = aiplatform_v1beta1.JobServiceClient() + client = aiplatform_v1beta1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.CancelCustomJobRequest( @@ -750,7 +750,7 @@ def sample_cancel_custom_job(): ) # Make the request - client.cancel_custom_job(request=request) + await client.cancel_custom_job(request=request) Args: request (Union[google.cloud.aiplatform_v1beta1.types.CancelCustomJobRequest, dict]): @@ -824,9 +824,9 @@ async def create_data_labeling_job( from google.cloud import aiplatform_v1beta1 - def sample_create_data_labeling_job(): + async def sample_create_data_labeling_job(): # Create a client - client = aiplatform_v1beta1.JobServiceClient() + client = aiplatform_v1beta1.JobServiceAsyncClient() # Initialize request argument(s) data_labeling_job = aiplatform_v1beta1.DataLabelingJob() @@ -843,7 +843,7 @@ def sample_create_data_labeling_job(): ) # Make the request - response = client.create_data_labeling_job(request=request) + response = await client.create_data_labeling_job(request=request) # Handle the response print(response) @@ -938,9 +938,9 @@ async def get_data_labeling_job( from google.cloud import aiplatform_v1beta1 - def sample_get_data_labeling_job(): + async def sample_get_data_labeling_job(): # Create a client - client = aiplatform_v1beta1.JobServiceClient() + client = aiplatform_v1beta1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.GetDataLabelingJobRequest( @@ -948,7 +948,7 @@ def sample_get_data_labeling_job(): ) # Make the request - response = client.get_data_labeling_job(request=request) + response = await client.get_data_labeling_job(request=request) # Handle the response print(response) @@ -1034,9 +1034,9 @@ async def list_data_labeling_jobs( from google.cloud import aiplatform_v1beta1 - def sample_list_data_labeling_jobs(): + async def sample_list_data_labeling_jobs(): # Create a client - client = aiplatform_v1beta1.JobServiceClient() + client = aiplatform_v1beta1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.ListDataLabelingJobsRequest( @@ -1047,7 +1047,7 @@ def sample_list_data_labeling_jobs(): page_result = client.list_data_labeling_jobs(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1142,9 +1142,9 @@ async def delete_data_labeling_job( from google.cloud import aiplatform_v1beta1 - def sample_delete_data_labeling_job(): + async def sample_delete_data_labeling_job(): # Create a client - client = aiplatform_v1beta1.JobServiceClient() + client = aiplatform_v1beta1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.DeleteDataLabelingJobRequest( @@ -1156,7 +1156,7 @@ def sample_delete_data_labeling_job(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1264,9 +1264,9 @@ async def cancel_data_labeling_job( from google.cloud import aiplatform_v1beta1 - def sample_cancel_data_labeling_job(): + async def sample_cancel_data_labeling_job(): # Create a client - client = aiplatform_v1beta1.JobServiceClient() + client = aiplatform_v1beta1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.CancelDataLabelingJobRequest( @@ -1274,7 +1274,7 @@ def sample_cancel_data_labeling_job(): ) # Make the request - client.cancel_data_labeling_job(request=request) + await client.cancel_data_labeling_job(request=request) Args: request (Union[google.cloud.aiplatform_v1beta1.types.CancelDataLabelingJobRequest, dict]): @@ -1348,9 +1348,9 @@ async def create_hyperparameter_tuning_job( from google.cloud import aiplatform_v1beta1 - def sample_create_hyperparameter_tuning_job(): + async def sample_create_hyperparameter_tuning_job(): # Create a client - client = aiplatform_v1beta1.JobServiceClient() + client = aiplatform_v1beta1.JobServiceAsyncClient() # Initialize request argument(s) hyperparameter_tuning_job = aiplatform_v1beta1.HyperparameterTuningJob() @@ -1370,7 +1370,7 @@ def sample_create_hyperparameter_tuning_job(): ) # Make the request - response = client.create_hyperparameter_tuning_job(request=request) + response = await client.create_hyperparameter_tuning_job(request=request) # Handle the response print(response) @@ -1467,9 +1467,9 @@ async def get_hyperparameter_tuning_job( from google.cloud import aiplatform_v1beta1 - def sample_get_hyperparameter_tuning_job(): + async def sample_get_hyperparameter_tuning_job(): # Create a client - client = aiplatform_v1beta1.JobServiceClient() + client = aiplatform_v1beta1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.GetHyperparameterTuningJobRequest( @@ -1477,7 +1477,7 @@ def sample_get_hyperparameter_tuning_job(): ) # Make the request - response = client.get_hyperparameter_tuning_job(request=request) + response = await client.get_hyperparameter_tuning_job(request=request) # Handle the response print(response) @@ -1565,9 +1565,9 @@ async def list_hyperparameter_tuning_jobs( from google.cloud import aiplatform_v1beta1 - def sample_list_hyperparameter_tuning_jobs(): + async def sample_list_hyperparameter_tuning_jobs(): # Create a client - client = aiplatform_v1beta1.JobServiceClient() + client = aiplatform_v1beta1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.ListHyperparameterTuningJobsRequest( @@ -1578,7 +1578,7 @@ def sample_list_hyperparameter_tuning_jobs(): page_result = client.list_hyperparameter_tuning_jobs(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1674,9 +1674,9 @@ async def delete_hyperparameter_tuning_job( from google.cloud import aiplatform_v1beta1 - def sample_delete_hyperparameter_tuning_job(): + async def sample_delete_hyperparameter_tuning_job(): # Create a client - client = aiplatform_v1beta1.JobServiceClient() + client = aiplatform_v1beta1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.DeleteHyperparameterTuningJobRequest( @@ -1688,7 +1688,7 @@ def sample_delete_hyperparameter_tuning_job(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1808,9 +1808,9 @@ async def cancel_hyperparameter_tuning_job( from google.cloud import aiplatform_v1beta1 - def sample_cancel_hyperparameter_tuning_job(): + async def sample_cancel_hyperparameter_tuning_job(): # Create a client - client = aiplatform_v1beta1.JobServiceClient() + client = aiplatform_v1beta1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.CancelHyperparameterTuningJobRequest( @@ -1818,7 +1818,7 @@ def sample_cancel_hyperparameter_tuning_job(): ) # Make the request - client.cancel_hyperparameter_tuning_job(request=request) + await client.cancel_hyperparameter_tuning_job(request=request) Args: request (Union[google.cloud.aiplatform_v1beta1.types.CancelHyperparameterTuningJobRequest, dict]): @@ -1894,9 +1894,9 @@ async def create_batch_prediction_job( from google.cloud import aiplatform_v1beta1 - def sample_create_batch_prediction_job(): + async def sample_create_batch_prediction_job(): # Create a client - client = aiplatform_v1beta1.JobServiceClient() + client = aiplatform_v1beta1.JobServiceAsyncClient() # Initialize request argument(s) batch_prediction_job = aiplatform_v1beta1.BatchPredictionJob() @@ -1912,7 +1912,7 @@ def sample_create_batch_prediction_job(): ) # Make the request - response = client.create_batch_prediction_job(request=request) + response = await client.create_batch_prediction_job(request=request) # Handle the response print(response) @@ -2011,9 +2011,9 @@ async def get_batch_prediction_job( from google.cloud import aiplatform_v1beta1 - def sample_get_batch_prediction_job(): + async def sample_get_batch_prediction_job(): # Create a client - client = aiplatform_v1beta1.JobServiceClient() + client = aiplatform_v1beta1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.GetBatchPredictionJobRequest( @@ -2021,7 +2021,7 @@ def sample_get_batch_prediction_job(): ) # Make the request - response = client.get_batch_prediction_job(request=request) + response = await client.get_batch_prediction_job(request=request) # Handle the response print(response) @@ -2111,9 +2111,9 @@ async def list_batch_prediction_jobs( from google.cloud import aiplatform_v1beta1 - def sample_list_batch_prediction_jobs(): + async def sample_list_batch_prediction_jobs(): # Create a client - client = aiplatform_v1beta1.JobServiceClient() + client = aiplatform_v1beta1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.ListBatchPredictionJobsRequest( @@ -2124,7 +2124,7 @@ def sample_list_batch_prediction_jobs(): page_result = client.list_batch_prediction_jobs(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -2221,9 +2221,9 @@ async def delete_batch_prediction_job( from google.cloud import aiplatform_v1beta1 - def sample_delete_batch_prediction_job(): + async def sample_delete_batch_prediction_job(): # Create a client - client = aiplatform_v1beta1.JobServiceClient() + client = aiplatform_v1beta1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.DeleteBatchPredictionJobRequest( @@ -2235,7 +2235,7 @@ def sample_delete_batch_prediction_job(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -2353,9 +2353,9 @@ async def cancel_batch_prediction_job( from google.cloud import aiplatform_v1beta1 - def sample_cancel_batch_prediction_job(): + async def sample_cancel_batch_prediction_job(): # Create a client - client = aiplatform_v1beta1.JobServiceClient() + client = aiplatform_v1beta1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.CancelBatchPredictionJobRequest( @@ -2363,7 +2363,7 @@ def sample_cancel_batch_prediction_job(): ) # Make the request - client.cancel_batch_prediction_job(request=request) + await client.cancel_batch_prediction_job(request=request) Args: request (Union[google.cloud.aiplatform_v1beta1.types.CancelBatchPredictionJobRequest, dict]): @@ -2441,9 +2441,9 @@ async def create_model_deployment_monitoring_job( from google.cloud import aiplatform_v1beta1 - def sample_create_model_deployment_monitoring_job(): + async def sample_create_model_deployment_monitoring_job(): # Create a client - client = aiplatform_v1beta1.JobServiceClient() + client = aiplatform_v1beta1.JobServiceAsyncClient() # Initialize request argument(s) model_deployment_monitoring_job = aiplatform_v1beta1.ModelDeploymentMonitoringJob() @@ -2456,7 +2456,7 @@ def sample_create_model_deployment_monitoring_job(): ) # Make the request - response = client.create_model_deployment_monitoring_job(request=request) + response = await client.create_model_deployment_monitoring_job(request=request) # Handle the response print(response) @@ -2558,9 +2558,9 @@ async def search_model_deployment_monitoring_stats_anomalies( from google.cloud import aiplatform_v1beta1 - def sample_search_model_deployment_monitoring_stats_anomalies(): + async def sample_search_model_deployment_monitoring_stats_anomalies(): # Create a client - client = aiplatform_v1beta1.JobServiceClient() + client = aiplatform_v1beta1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.SearchModelDeploymentMonitoringStatsAnomaliesRequest( @@ -2572,7 +2572,7 @@ def sample_search_model_deployment_monitoring_stats_anomalies(): page_result = client.search_model_deployment_monitoring_stats_anomalies(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -2686,9 +2686,9 @@ async def get_model_deployment_monitoring_job( from google.cloud import aiplatform_v1beta1 - def sample_get_model_deployment_monitoring_job(): + async def sample_get_model_deployment_monitoring_job(): # Create a client - client = aiplatform_v1beta1.JobServiceClient() + client = aiplatform_v1beta1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.GetModelDeploymentMonitoringJobRequest( @@ -2696,7 +2696,7 @@ def sample_get_model_deployment_monitoring_job(): ) # Make the request - response = client.get_model_deployment_monitoring_job(request=request) + response = await client.get_model_deployment_monitoring_job(request=request) # Handle the response print(response) @@ -2787,9 +2787,9 @@ async def list_model_deployment_monitoring_jobs( from google.cloud import aiplatform_v1beta1 - def sample_list_model_deployment_monitoring_jobs(): + async def sample_list_model_deployment_monitoring_jobs(): # Create a client - client = aiplatform_v1beta1.JobServiceClient() + client = aiplatform_v1beta1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.ListModelDeploymentMonitoringJobsRequest( @@ -2800,7 +2800,7 @@ def sample_list_model_deployment_monitoring_jobs(): page_result = client.list_model_deployment_monitoring_jobs(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -2899,9 +2899,9 @@ async def update_model_deployment_monitoring_job( from google.cloud import aiplatform_v1beta1 - def sample_update_model_deployment_monitoring_job(): + async def sample_update_model_deployment_monitoring_job(): # Create a client - client = aiplatform_v1beta1.JobServiceClient() + client = aiplatform_v1beta1.JobServiceAsyncClient() # Initialize request argument(s) model_deployment_monitoring_job = aiplatform_v1beta1.ModelDeploymentMonitoringJob() @@ -2917,7 +2917,7 @@ def sample_update_model_deployment_monitoring_job(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -3058,9 +3058,9 @@ async def delete_model_deployment_monitoring_job( from google.cloud import aiplatform_v1beta1 - def sample_delete_model_deployment_monitoring_job(): + async def sample_delete_model_deployment_monitoring_job(): # Create a client - client = aiplatform_v1beta1.JobServiceClient() + client = aiplatform_v1beta1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.DeleteModelDeploymentMonitoringJobRequest( @@ -3072,7 +3072,7 @@ def sample_delete_model_deployment_monitoring_job(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -3184,9 +3184,9 @@ async def pause_model_deployment_monitoring_job( from google.cloud import aiplatform_v1beta1 - def sample_pause_model_deployment_monitoring_job(): + async def sample_pause_model_deployment_monitoring_job(): # Create a client - client = aiplatform_v1beta1.JobServiceClient() + client = aiplatform_v1beta1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.PauseModelDeploymentMonitoringJobRequest( @@ -3194,7 +3194,7 @@ def sample_pause_model_deployment_monitoring_job(): ) # Make the request - client.pause_model_deployment_monitoring_job(request=request) + await client.pause_model_deployment_monitoring_job(request=request) Args: request (Union[google.cloud.aiplatform_v1beta1.types.PauseModelDeploymentMonitoringJobRequest, dict]): @@ -3272,9 +3272,9 @@ async def resume_model_deployment_monitoring_job( from google.cloud import aiplatform_v1beta1 - def sample_resume_model_deployment_monitoring_job(): + async def sample_resume_model_deployment_monitoring_job(): # Create a client - client = aiplatform_v1beta1.JobServiceClient() + client = aiplatform_v1beta1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.ResumeModelDeploymentMonitoringJobRequest( @@ -3282,7 +3282,7 @@ def sample_resume_model_deployment_monitoring_job(): ) # Make the request - client.resume_model_deployment_monitoring_job(request=request) + await client.resume_model_deployment_monitoring_job(request=request) Args: request (Union[google.cloud.aiplatform_v1beta1.types.ResumeModelDeploymentMonitoringJobRequest, dict]): diff --git a/google/cloud/aiplatform_v1beta1/services/metadata_service/async_client.py b/google/cloud/aiplatform_v1beta1/services/metadata_service/async_client.py index a17981e5c4..f211a68be9 100644 --- a/google/cloud/aiplatform_v1beta1/services/metadata_service/async_client.py +++ b/google/cloud/aiplatform_v1beta1/services/metadata_service/async_client.py @@ -252,9 +252,9 @@ async def create_metadata_store( from google.cloud import aiplatform_v1beta1 - def sample_create_metadata_store(): + async def sample_create_metadata_store(): # Create a client - client = aiplatform_v1beta1.MetadataServiceClient() + client = aiplatform_v1beta1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.CreateMetadataStoreRequest( @@ -266,7 +266,7 @@ def sample_create_metadata_store(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -388,9 +388,9 @@ async def get_metadata_store( from google.cloud import aiplatform_v1beta1 - def sample_get_metadata_store(): + async def sample_get_metadata_store(): # Create a client - client = aiplatform_v1beta1.MetadataServiceClient() + client = aiplatform_v1beta1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.GetMetadataStoreRequest( @@ -398,7 +398,7 @@ def sample_get_metadata_store(): ) # Make the request - response = client.get_metadata_store(request=request) + response = await client.get_metadata_store(request=request) # Handle the response print(response) @@ -485,9 +485,9 @@ async def list_metadata_stores( from google.cloud import aiplatform_v1beta1 - def sample_list_metadata_stores(): + async def sample_list_metadata_stores(): # Create a client - client = aiplatform_v1beta1.MetadataServiceClient() + client = aiplatform_v1beta1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.ListMetadataStoresRequest( @@ -498,7 +498,7 @@ def sample_list_metadata_stores(): page_result = client.list_metadata_stores(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -595,9 +595,9 @@ async def delete_metadata_store( from google.cloud import aiplatform_v1beta1 - def sample_delete_metadata_store(): + async def sample_delete_metadata_store(): # Create a client - client = aiplatform_v1beta1.MetadataServiceClient() + client = aiplatform_v1beta1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.DeleteMetadataStoreRequest( @@ -609,7 +609,7 @@ def sample_delete_metadata_store(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -718,9 +718,9 @@ async def create_artifact( from google.cloud import aiplatform_v1beta1 - def sample_create_artifact(): + async def sample_create_artifact(): # Create a client - client = aiplatform_v1beta1.MetadataServiceClient() + client = aiplatform_v1beta1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.CreateArtifactRequest( @@ -728,7 +728,7 @@ def sample_create_artifact(): ) # Make the request - response = client.create_artifact(request=request) + response = await client.create_artifact(request=request) # Handle the response print(response) @@ -836,9 +836,9 @@ async def get_artifact( from google.cloud import aiplatform_v1beta1 - def sample_get_artifact(): + async def sample_get_artifact(): # Create a client - client = aiplatform_v1beta1.MetadataServiceClient() + client = aiplatform_v1beta1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.GetArtifactRequest( @@ -846,7 +846,7 @@ def sample_get_artifact(): ) # Make the request - response = client.get_artifact(request=request) + response = await client.get_artifact(request=request) # Handle the response print(response) @@ -930,9 +930,9 @@ async def list_artifacts( from google.cloud import aiplatform_v1beta1 - def sample_list_artifacts(): + async def sample_list_artifacts(): # Create a client - client = aiplatform_v1beta1.MetadataServiceClient() + client = aiplatform_v1beta1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.ListArtifactsRequest( @@ -943,7 +943,7 @@ def sample_list_artifacts(): page_result = client.list_artifacts(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1040,16 +1040,16 @@ async def update_artifact( from google.cloud import aiplatform_v1beta1 - def sample_update_artifact(): + async def sample_update_artifact(): # Create a client - client = aiplatform_v1beta1.MetadataServiceClient() + client = aiplatform_v1beta1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.UpdateArtifactRequest( ) # Make the request - response = client.update_artifact(request=request) + response = await client.update_artifact(request=request) # Handle the response print(response) @@ -1149,9 +1149,9 @@ async def delete_artifact( from google.cloud import aiplatform_v1beta1 - def sample_delete_artifact(): + async def sample_delete_artifact(): # Create a client - client = aiplatform_v1beta1.MetadataServiceClient() + client = aiplatform_v1beta1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.DeleteArtifactRequest( @@ -1163,7 +1163,7 @@ def sample_delete_artifact(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1270,9 +1270,9 @@ async def purge_artifacts( from google.cloud import aiplatform_v1beta1 - def sample_purge_artifacts(): + async def sample_purge_artifacts(): # Create a client - client = aiplatform_v1beta1.MetadataServiceClient() + client = aiplatform_v1beta1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.PurgeArtifactsRequest( @@ -1285,7 +1285,7 @@ def sample_purge_artifacts(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1385,9 +1385,9 @@ async def create_context( from google.cloud import aiplatform_v1beta1 - def sample_create_context(): + async def sample_create_context(): # Create a client - client = aiplatform_v1beta1.MetadataServiceClient() + client = aiplatform_v1beta1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.CreateContextRequest( @@ -1395,7 +1395,7 @@ def sample_create_context(): ) # Make the request - response = client.create_context(request=request) + response = await client.create_context(request=request) # Handle the response print(response) @@ -1503,9 +1503,9 @@ async def get_context( from google.cloud import aiplatform_v1beta1 - def sample_get_context(): + async def sample_get_context(): # Create a client - client = aiplatform_v1beta1.MetadataServiceClient() + client = aiplatform_v1beta1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.GetContextRequest( @@ -1513,7 +1513,7 @@ def sample_get_context(): ) # Make the request - response = client.get_context(request=request) + response = await client.get_context(request=request) # Handle the response print(response) @@ -1597,9 +1597,9 @@ async def list_contexts( from google.cloud import aiplatform_v1beta1 - def sample_list_contexts(): + async def sample_list_contexts(): # Create a client - client = aiplatform_v1beta1.MetadataServiceClient() + client = aiplatform_v1beta1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.ListContextsRequest( @@ -1610,7 +1610,7 @@ def sample_list_contexts(): page_result = client.list_contexts(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1707,16 +1707,16 @@ async def update_context( from google.cloud import aiplatform_v1beta1 - def sample_update_context(): + async def sample_update_context(): # Create a client - client = aiplatform_v1beta1.MetadataServiceClient() + client = aiplatform_v1beta1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.UpdateContextRequest( ) # Make the request - response = client.update_context(request=request) + response = await client.update_context(request=request) # Handle the response print(response) @@ -1815,9 +1815,9 @@ async def delete_context( from google.cloud import aiplatform_v1beta1 - def sample_delete_context(): + async def sample_delete_context(): # Create a client - client = aiplatform_v1beta1.MetadataServiceClient() + client = aiplatform_v1beta1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.DeleteContextRequest( @@ -1829,7 +1829,7 @@ def sample_delete_context(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1936,9 +1936,9 @@ async def purge_contexts( from google.cloud import aiplatform_v1beta1 - def sample_purge_contexts(): + async def sample_purge_contexts(): # Create a client - client = aiplatform_v1beta1.MetadataServiceClient() + client = aiplatform_v1beta1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.PurgeContextsRequest( @@ -1951,7 +1951,7 @@ def sample_purge_contexts(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -2055,9 +2055,9 @@ async def add_context_artifacts_and_executions( from google.cloud import aiplatform_v1beta1 - def sample_add_context_artifacts_and_executions(): + async def sample_add_context_artifacts_and_executions(): # Create a client - client = aiplatform_v1beta1.MetadataServiceClient() + client = aiplatform_v1beta1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.AddContextArtifactsAndExecutionsRequest( @@ -2065,7 +2065,7 @@ def sample_add_context_artifacts_and_executions(): ) # Make the request - response = client.add_context_artifacts_and_executions(request=request) + response = await client.add_context_artifacts_and_executions(request=request) # Handle the response print(response) @@ -2180,9 +2180,9 @@ async def add_context_children( from google.cloud import aiplatform_v1beta1 - def sample_add_context_children(): + async def sample_add_context_children(): # Create a client - client = aiplatform_v1beta1.MetadataServiceClient() + client = aiplatform_v1beta1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.AddContextChildrenRequest( @@ -2190,7 +2190,7 @@ def sample_add_context_children(): ) # Make the request - response = client.add_context_children(request=request) + response = await client.add_context_children(request=request) # Handle the response print(response) @@ -2290,9 +2290,9 @@ async def query_context_lineage_subgraph( from google.cloud import aiplatform_v1beta1 - def sample_query_context_lineage_subgraph(): + async def sample_query_context_lineage_subgraph(): # Create a client - client = aiplatform_v1beta1.MetadataServiceClient() + client = aiplatform_v1beta1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.QueryContextLineageSubgraphRequest( @@ -2300,7 +2300,7 @@ def sample_query_context_lineage_subgraph(): ) # Make the request - response = client.query_context_lineage_subgraph(request=request) + response = await client.query_context_lineage_subgraph(request=request) # Handle the response print(response) @@ -2395,9 +2395,9 @@ async def create_execution( from google.cloud import aiplatform_v1beta1 - def sample_create_execution(): + async def sample_create_execution(): # Create a client - client = aiplatform_v1beta1.MetadataServiceClient() + client = aiplatform_v1beta1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.CreateExecutionRequest( @@ -2405,7 +2405,7 @@ def sample_create_execution(): ) # Make the request - response = client.create_execution(request=request) + response = await client.create_execution(request=request) # Handle the response print(response) @@ -2513,9 +2513,9 @@ async def get_execution( from google.cloud import aiplatform_v1beta1 - def sample_get_execution(): + async def sample_get_execution(): # Create a client - client = aiplatform_v1beta1.MetadataServiceClient() + client = aiplatform_v1beta1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.GetExecutionRequest( @@ -2523,7 +2523,7 @@ def sample_get_execution(): ) # Make the request - response = client.get_execution(request=request) + response = await client.get_execution(request=request) # Handle the response print(response) @@ -2607,9 +2607,9 @@ async def list_executions( from google.cloud import aiplatform_v1beta1 - def sample_list_executions(): + async def sample_list_executions(): # Create a client - client = aiplatform_v1beta1.MetadataServiceClient() + client = aiplatform_v1beta1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.ListExecutionsRequest( @@ -2620,7 +2620,7 @@ def sample_list_executions(): page_result = client.list_executions(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -2717,16 +2717,16 @@ async def update_execution( from google.cloud import aiplatform_v1beta1 - def sample_update_execution(): + async def sample_update_execution(): # Create a client - client = aiplatform_v1beta1.MetadataServiceClient() + client = aiplatform_v1beta1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.UpdateExecutionRequest( ) # Make the request - response = client.update_execution(request=request) + response = await client.update_execution(request=request) # Handle the response print(response) @@ -2826,9 +2826,9 @@ async def delete_execution( from google.cloud import aiplatform_v1beta1 - def sample_delete_execution(): + async def sample_delete_execution(): # Create a client - client = aiplatform_v1beta1.MetadataServiceClient() + client = aiplatform_v1beta1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.DeleteExecutionRequest( @@ -2840,7 +2840,7 @@ def sample_delete_execution(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -2947,9 +2947,9 @@ async def purge_executions( from google.cloud import aiplatform_v1beta1 - def sample_purge_executions(): + async def sample_purge_executions(): # Create a client - client = aiplatform_v1beta1.MetadataServiceClient() + client = aiplatform_v1beta1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.PurgeExecutionsRequest( @@ -2962,7 +2962,7 @@ def sample_purge_executions(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -3065,9 +3065,9 @@ async def add_execution_events( from google.cloud import aiplatform_v1beta1 - def sample_add_execution_events(): + async def sample_add_execution_events(): # Create a client - client = aiplatform_v1beta1.MetadataServiceClient() + client = aiplatform_v1beta1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.AddExecutionEventsRequest( @@ -3075,7 +3075,7 @@ def sample_add_execution_events(): ) # Make the request - response = client.add_execution_events(request=request) + response = await client.add_execution_events(request=request) # Handle the response print(response) @@ -3174,9 +3174,9 @@ async def query_execution_inputs_and_outputs( from google.cloud import aiplatform_v1beta1 - def sample_query_execution_inputs_and_outputs(): + async def sample_query_execution_inputs_and_outputs(): # Create a client - client = aiplatform_v1beta1.MetadataServiceClient() + client = aiplatform_v1beta1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.QueryExecutionInputsAndOutputsRequest( @@ -3184,7 +3184,7 @@ def sample_query_execution_inputs_and_outputs(): ) # Make the request - response = client.query_execution_inputs_and_outputs(request=request) + response = await client.query_execution_inputs_and_outputs(request=request) # Handle the response print(response) @@ -3276,9 +3276,9 @@ async def create_metadata_schema( from google.cloud import aiplatform_v1beta1 - def sample_create_metadata_schema(): + async def sample_create_metadata_schema(): # Create a client - client = aiplatform_v1beta1.MetadataServiceClient() + client = aiplatform_v1beta1.MetadataServiceAsyncClient() # Initialize request argument(s) metadata_schema = aiplatform_v1beta1.MetadataSchema() @@ -3290,7 +3290,7 @@ def sample_create_metadata_schema(): ) # Make the request - response = client.create_metadata_schema(request=request) + response = await client.create_metadata_schema(request=request) # Handle the response print(response) @@ -3400,9 +3400,9 @@ async def get_metadata_schema( from google.cloud import aiplatform_v1beta1 - def sample_get_metadata_schema(): + async def sample_get_metadata_schema(): # Create a client - client = aiplatform_v1beta1.MetadataServiceClient() + client = aiplatform_v1beta1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.GetMetadataSchemaRequest( @@ -3410,7 +3410,7 @@ def sample_get_metadata_schema(): ) # Make the request - response = client.get_metadata_schema(request=request) + response = await client.get_metadata_schema(request=request) # Handle the response print(response) @@ -3494,9 +3494,9 @@ async def list_metadata_schemas( from google.cloud import aiplatform_v1beta1 - def sample_list_metadata_schemas(): + async def sample_list_metadata_schemas(): # Create a client - client = aiplatform_v1beta1.MetadataServiceClient() + client = aiplatform_v1beta1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.ListMetadataSchemasRequest( @@ -3507,7 +3507,7 @@ def sample_list_metadata_schemas(): page_result = client.list_metadata_schemas(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -3607,9 +3607,9 @@ async def query_artifact_lineage_subgraph( from google.cloud import aiplatform_v1beta1 - def sample_query_artifact_lineage_subgraph(): + async def sample_query_artifact_lineage_subgraph(): # Create a client - client = aiplatform_v1beta1.MetadataServiceClient() + client = aiplatform_v1beta1.MetadataServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.QueryArtifactLineageSubgraphRequest( @@ -3617,7 +3617,7 @@ def sample_query_artifact_lineage_subgraph(): ) # Make the request - response = client.query_artifact_lineage_subgraph(request=request) + response = await client.query_artifact_lineage_subgraph(request=request) # Handle the response print(response) diff --git a/google/cloud/aiplatform_v1beta1/services/migration_service/async_client.py b/google/cloud/aiplatform_v1beta1/services/migration_service/async_client.py index 8728c3f1ed..ae73e9932e 100644 --- a/google/cloud/aiplatform_v1beta1/services/migration_service/async_client.py +++ b/google/cloud/aiplatform_v1beta1/services/migration_service/async_client.py @@ -239,9 +239,9 @@ async def search_migratable_resources( from google.cloud import aiplatform_v1beta1 - def sample_search_migratable_resources(): + async def sample_search_migratable_resources(): # Create a client - client = aiplatform_v1beta1.MigrationServiceClient() + client = aiplatform_v1beta1.MigrationServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.SearchMigratableResourcesRequest( @@ -252,7 +252,7 @@ def sample_search_migratable_resources(): page_result = client.search_migratable_resources(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -355,9 +355,9 @@ async def batch_migrate_resources( from google.cloud import aiplatform_v1beta1 - def sample_batch_migrate_resources(): + async def sample_batch_migrate_resources(): # Create a client - client = aiplatform_v1beta1.MigrationServiceClient() + client = aiplatform_v1beta1.MigrationServiceAsyncClient() # Initialize request argument(s) migrate_resource_requests = aiplatform_v1beta1.MigrateResourceRequest() @@ -375,7 +375,7 @@ def sample_batch_migrate_resources(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) diff --git a/google/cloud/aiplatform_v1beta1/services/migration_service/client.py b/google/cloud/aiplatform_v1beta1/services/migration_service/client.py index c8a4120cef..3a0ca7952d 100644 --- a/google/cloud/aiplatform_v1beta1/services/migration_service/client.py +++ b/google/cloud/aiplatform_v1beta1/services/migration_service/client.py @@ -192,40 +192,40 @@ def parse_annotated_dataset_path(path: str) -> Dict[str, str]: @staticmethod def dataset_path( project: str, - location: str, dataset: str, ) -> str: """Returns a fully-qualified dataset string.""" - return "projects/{project}/locations/{location}/datasets/{dataset}".format( + return "projects/{project}/datasets/{dataset}".format( project=project, - location=location, dataset=dataset, ) @staticmethod def parse_dataset_path(path: str) -> Dict[str, str]: """Parses a dataset path into its component segments.""" - m = re.match( - r"^projects/(?P.+?)/locations/(?P.+?)/datasets/(?P.+?)$", - path, - ) + m = re.match(r"^projects/(?P.+?)/datasets/(?P.+?)$", path) return m.groupdict() if m else {} @staticmethod def dataset_path( project: str, + location: str, dataset: str, ) -> str: """Returns a fully-qualified dataset string.""" - return "projects/{project}/datasets/{dataset}".format( + return "projects/{project}/locations/{location}/datasets/{dataset}".format( project=project, + location=location, dataset=dataset, ) @staticmethod def parse_dataset_path(path: str) -> Dict[str, str]: """Parses a dataset path into its component segments.""" - m = re.match(r"^projects/(?P.+?)/datasets/(?P.+?)$", path) + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/datasets/(?P.+?)$", + path, + ) return m.groupdict() if m else {} @staticmethod diff --git a/google/cloud/aiplatform_v1beta1/services/model_service/async_client.py b/google/cloud/aiplatform_v1beta1/services/model_service/async_client.py index 897819a3ec..961278f9e0 100644 --- a/google/cloud/aiplatform_v1beta1/services/model_service/async_client.py +++ b/google/cloud/aiplatform_v1beta1/services/model_service/async_client.py @@ -247,9 +247,9 @@ async def upload_model( from google.cloud import aiplatform_v1beta1 - def sample_upload_model(): + async def sample_upload_model(): # Create a client - client = aiplatform_v1beta1.ModelServiceClient() + client = aiplatform_v1beta1.ModelServiceAsyncClient() # Initialize request argument(s) model = aiplatform_v1beta1.Model() @@ -265,7 +265,7 @@ def sample_upload_model(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -371,9 +371,9 @@ async def get_model( from google.cloud import aiplatform_v1beta1 - def sample_get_model(): + async def sample_get_model(): # Create a client - client = aiplatform_v1beta1.ModelServiceClient() + client = aiplatform_v1beta1.ModelServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.GetModelRequest( @@ -381,7 +381,7 @@ def sample_get_model(): ) # Make the request - response = client.get_model(request=request) + response = await client.get_model(request=request) # Handle the response print(response) @@ -464,9 +464,9 @@ async def list_models( from google.cloud import aiplatform_v1beta1 - def sample_list_models(): + async def sample_list_models(): # Create a client - client = aiplatform_v1beta1.ModelServiceClient() + client = aiplatform_v1beta1.ModelServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.ListModelsRequest( @@ -477,7 +477,7 @@ def sample_list_models(): page_result = client.list_models(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -573,9 +573,9 @@ async def list_model_versions( from google.cloud import aiplatform_v1beta1 - def sample_list_model_versions(): + async def sample_list_model_versions(): # Create a client - client = aiplatform_v1beta1.ModelServiceClient() + client = aiplatform_v1beta1.ModelServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.ListModelVersionsRequest( @@ -586,7 +586,7 @@ def sample_list_model_versions(): page_result = client.list_model_versions(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -682,9 +682,9 @@ async def update_model( from google.cloud import aiplatform_v1beta1 - def sample_update_model(): + async def sample_update_model(): # Create a client - client = aiplatform_v1beta1.ModelServiceClient() + client = aiplatform_v1beta1.ModelServiceAsyncClient() # Initialize request argument(s) model = aiplatform_v1beta1.Model() @@ -695,7 +695,7 @@ def sample_update_model(): ) # Make the request - response = client.update_model(request=request) + response = await client.update_model(request=request) # Handle the response print(response) @@ -819,9 +819,9 @@ async def delete_model( from google.cloud import aiplatform_v1beta1 - def sample_delete_model(): + async def sample_delete_model(): # Create a client - client = aiplatform_v1beta1.ModelServiceClient() + client = aiplatform_v1beta1.ModelServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.DeleteModelRequest( @@ -833,7 +833,7 @@ def sample_delete_model(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -946,9 +946,9 @@ async def delete_model_version( from google.cloud import aiplatform_v1beta1 - def sample_delete_model_version(): + async def sample_delete_model_version(): # Create a client - client = aiplatform_v1beta1.ModelServiceClient() + client = aiplatform_v1beta1.ModelServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.DeleteModelVersionRequest( @@ -960,7 +960,7 @@ def sample_delete_model_version(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1070,9 +1070,9 @@ async def merge_version_aliases( from google.cloud import aiplatform_v1beta1 - def sample_merge_version_aliases(): + async def sample_merge_version_aliases(): # Create a client - client = aiplatform_v1beta1.ModelServiceClient() + client = aiplatform_v1beta1.ModelServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.MergeVersionAliasesRequest( @@ -1081,7 +1081,7 @@ def sample_merge_version_aliases(): ) # Make the request - response = client.merge_version_aliases(request=request) + response = await client.merge_version_aliases(request=request) # Handle the response print(response) @@ -1193,9 +1193,9 @@ async def export_model( from google.cloud import aiplatform_v1beta1 - def sample_export_model(): + async def sample_export_model(): # Create a client - client = aiplatform_v1beta1.ModelServiceClient() + client = aiplatform_v1beta1.ModelServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.ExportModelRequest( @@ -1207,7 +1207,7 @@ def sample_export_model(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1315,9 +1315,9 @@ async def import_model_evaluation( from google.cloud import aiplatform_v1beta1 - def sample_import_model_evaluation(): + async def sample_import_model_evaluation(): # Create a client - client = aiplatform_v1beta1.ModelServiceClient() + client = aiplatform_v1beta1.ModelServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.ImportModelEvaluationRequest( @@ -1325,7 +1325,7 @@ def sample_import_model_evaluation(): ) # Make the request - response = client.import_model_evaluation(request=request) + response = await client.import_model_evaluation(request=request) # Handle the response print(response) @@ -1421,9 +1421,9 @@ async def get_model_evaluation( from google.cloud import aiplatform_v1beta1 - def sample_get_model_evaluation(): + async def sample_get_model_evaluation(): # Create a client - client = aiplatform_v1beta1.ModelServiceClient() + client = aiplatform_v1beta1.ModelServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.GetModelEvaluationRequest( @@ -1431,7 +1431,7 @@ def sample_get_model_evaluation(): ) # Make the request - response = client.get_model_evaluation(request=request) + response = await client.get_model_evaluation(request=request) # Handle the response print(response) @@ -1519,9 +1519,9 @@ async def list_model_evaluations( from google.cloud import aiplatform_v1beta1 - def sample_list_model_evaluations(): + async def sample_list_model_evaluations(): # Create a client - client = aiplatform_v1beta1.ModelServiceClient() + client = aiplatform_v1beta1.ModelServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.ListModelEvaluationsRequest( @@ -1532,7 +1532,7 @@ def sample_list_model_evaluations(): page_result = client.list_model_evaluations(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1628,9 +1628,9 @@ async def get_model_evaluation_slice( from google.cloud import aiplatform_v1beta1 - def sample_get_model_evaluation_slice(): + async def sample_get_model_evaluation_slice(): # Create a client - client = aiplatform_v1beta1.ModelServiceClient() + client = aiplatform_v1beta1.ModelServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.GetModelEvaluationSliceRequest( @@ -1638,7 +1638,7 @@ def sample_get_model_evaluation_slice(): ) # Make the request - response = client.get_model_evaluation_slice(request=request) + response = await client.get_model_evaluation_slice(request=request) # Handle the response print(response) @@ -1726,9 +1726,9 @@ async def list_model_evaluation_slices( from google.cloud import aiplatform_v1beta1 - def sample_list_model_evaluation_slices(): + async def sample_list_model_evaluation_slices(): # Create a client - client = aiplatform_v1beta1.ModelServiceClient() + client = aiplatform_v1beta1.ModelServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.ListModelEvaluationSlicesRequest( @@ -1739,7 +1739,7 @@ def sample_list_model_evaluation_slices(): page_result = client.list_model_evaluation_slices(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: diff --git a/google/cloud/aiplatform_v1beta1/services/pipeline_service/async_client.py b/google/cloud/aiplatform_v1beta1/services/pipeline_service/async_client.py index 283878ea02..a590bb902d 100644 --- a/google/cloud/aiplatform_v1beta1/services/pipeline_service/async_client.py +++ b/google/cloud/aiplatform_v1beta1/services/pipeline_service/async_client.py @@ -259,9 +259,9 @@ async def create_training_pipeline( from google.cloud import aiplatform_v1beta1 - def sample_create_training_pipeline(): + async def sample_create_training_pipeline(): # Create a client - client = aiplatform_v1beta1.PipelineServiceClient() + client = aiplatform_v1beta1.PipelineServiceAsyncClient() # Initialize request argument(s) training_pipeline = aiplatform_v1beta1.TrainingPipeline() @@ -275,7 +275,7 @@ def sample_create_training_pipeline(): ) # Make the request - response = client.create_training_pipeline(request=request) + response = await client.create_training_pipeline(request=request) # Handle the response print(response) @@ -374,9 +374,9 @@ async def get_training_pipeline( from google.cloud import aiplatform_v1beta1 - def sample_get_training_pipeline(): + async def sample_get_training_pipeline(): # Create a client - client = aiplatform_v1beta1.PipelineServiceClient() + client = aiplatform_v1beta1.PipelineServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.GetTrainingPipelineRequest( @@ -384,7 +384,7 @@ def sample_get_training_pipeline(): ) # Make the request - response = client.get_training_pipeline(request=request) + response = await client.get_training_pipeline(request=request) # Handle the response print(response) @@ -474,9 +474,9 @@ async def list_training_pipelines( from google.cloud import aiplatform_v1beta1 - def sample_list_training_pipelines(): + async def sample_list_training_pipelines(): # Create a client - client = aiplatform_v1beta1.PipelineServiceClient() + client = aiplatform_v1beta1.PipelineServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.ListTrainingPipelinesRequest( @@ -487,7 +487,7 @@ def sample_list_training_pipelines(): page_result = client.list_training_pipelines(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -583,9 +583,9 @@ async def delete_training_pipeline( from google.cloud import aiplatform_v1beta1 - def sample_delete_training_pipeline(): + async def sample_delete_training_pipeline(): # Create a client - client = aiplatform_v1beta1.PipelineServiceClient() + client = aiplatform_v1beta1.PipelineServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.DeleteTrainingPipelineRequest( @@ -597,7 +597,7 @@ def sample_delete_training_pipeline(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -716,9 +716,9 @@ async def cancel_training_pipeline( from google.cloud import aiplatform_v1beta1 - def sample_cancel_training_pipeline(): + async def sample_cancel_training_pipeline(): # Create a client - client = aiplatform_v1beta1.PipelineServiceClient() + client = aiplatform_v1beta1.PipelineServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.CancelTrainingPipelineRequest( @@ -726,7 +726,7 @@ def sample_cancel_training_pipeline(): ) # Make the request - client.cancel_training_pipeline(request=request) + await client.cancel_training_pipeline(request=request) Args: request (Union[google.cloud.aiplatform_v1beta1.types.CancelTrainingPipelineRequest, dict]): @@ -803,9 +803,9 @@ async def create_pipeline_job( from google.cloud import aiplatform_v1beta1 - def sample_create_pipeline_job(): + async def sample_create_pipeline_job(): # Create a client - client = aiplatform_v1beta1.PipelineServiceClient() + client = aiplatform_v1beta1.PipelineServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.CreatePipelineJobRequest( @@ -813,7 +813,7 @@ def sample_create_pipeline_job(): ) # Make the request - response = client.create_pipeline_job(request=request) + response = await client.create_pipeline_job(request=request) # Handle the response print(response) @@ -919,9 +919,9 @@ async def get_pipeline_job( from google.cloud import aiplatform_v1beta1 - def sample_get_pipeline_job(): + async def sample_get_pipeline_job(): # Create a client - client = aiplatform_v1beta1.PipelineServiceClient() + client = aiplatform_v1beta1.PipelineServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.GetPipelineJobRequest( @@ -929,7 +929,7 @@ def sample_get_pipeline_job(): ) # Make the request - response = client.get_pipeline_job(request=request) + response = await client.get_pipeline_job(request=request) # Handle the response print(response) @@ -1014,9 +1014,9 @@ async def list_pipeline_jobs( from google.cloud import aiplatform_v1beta1 - def sample_list_pipeline_jobs(): + async def sample_list_pipeline_jobs(): # Create a client - client = aiplatform_v1beta1.PipelineServiceClient() + client = aiplatform_v1beta1.PipelineServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.ListPipelineJobsRequest( @@ -1027,7 +1027,7 @@ def sample_list_pipeline_jobs(): page_result = client.list_pipeline_jobs(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1123,9 +1123,9 @@ async def delete_pipeline_job( from google.cloud import aiplatform_v1beta1 - def sample_delete_pipeline_job(): + async def sample_delete_pipeline_job(): # Create a client - client = aiplatform_v1beta1.PipelineServiceClient() + client = aiplatform_v1beta1.PipelineServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.DeletePipelineJobRequest( @@ -1137,7 +1137,7 @@ def sample_delete_pipeline_job(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1256,9 +1256,9 @@ async def cancel_pipeline_job( from google.cloud import aiplatform_v1beta1 - def sample_cancel_pipeline_job(): + async def sample_cancel_pipeline_job(): # Create a client - client = aiplatform_v1beta1.PipelineServiceClient() + client = aiplatform_v1beta1.PipelineServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.CancelPipelineJobRequest( @@ -1266,7 +1266,7 @@ def sample_cancel_pipeline_job(): ) # Make the request - client.cancel_pipeline_job(request=request) + await client.cancel_pipeline_job(request=request) Args: request (Union[google.cloud.aiplatform_v1beta1.types.CancelPipelineJobRequest, dict]): diff --git a/google/cloud/aiplatform_v1beta1/services/prediction_service/async_client.py b/google/cloud/aiplatform_v1beta1/services/prediction_service/async_client.py index 6ef78767f1..50ca33e2c3 100644 --- a/google/cloud/aiplatform_v1beta1/services/prediction_service/async_client.py +++ b/google/cloud/aiplatform_v1beta1/services/prediction_service/async_client.py @@ -224,9 +224,9 @@ async def predict( from google.cloud import aiplatform_v1beta1 - def sample_predict(): + async def sample_predict(): # Create a client - client = aiplatform_v1beta1.PredictionServiceClient() + client = aiplatform_v1beta1.PredictionServiceAsyncClient() # Initialize request argument(s) instances = aiplatform_v1beta1.Value() @@ -238,7 +238,7 @@ def sample_predict(): ) # Make the request - response = client.predict(request=request) + response = await client.predict(request=request) # Handle the response print(response) @@ -366,9 +366,9 @@ async def raw_predict( from google.cloud import aiplatform_v1beta1 - def sample_raw_predict(): + async def sample_raw_predict(): # Create a client - client = aiplatform_v1beta1.PredictionServiceClient() + client = aiplatform_v1beta1.PredictionServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.RawPredictRequest( @@ -376,7 +376,7 @@ def sample_raw_predict(): ) # Make the request - response = client.raw_predict(request=request) + response = await client.raw_predict(request=request) # Handle the response print(response) @@ -548,9 +548,9 @@ async def explain( from google.cloud import aiplatform_v1beta1 - def sample_explain(): + async def sample_explain(): # Create a client - client = aiplatform_v1beta1.PredictionServiceClient() + client = aiplatform_v1beta1.PredictionServiceAsyncClient() # Initialize request argument(s) instances = aiplatform_v1beta1.Value() @@ -562,7 +562,7 @@ def sample_explain(): ) # Make the request - response = client.explain(request=request) + response = await client.explain(request=request) # Handle the response print(response) diff --git a/google/cloud/aiplatform_v1beta1/services/specialist_pool_service/async_client.py b/google/cloud/aiplatform_v1beta1/services/specialist_pool_service/async_client.py index 6fafc8eaf5..910fa3425c 100644 --- a/google/cloud/aiplatform_v1beta1/services/specialist_pool_service/async_client.py +++ b/google/cloud/aiplatform_v1beta1/services/specialist_pool_service/async_client.py @@ -240,9 +240,9 @@ async def create_specialist_pool( from google.cloud import aiplatform_v1beta1 - def sample_create_specialist_pool(): + async def sample_create_specialist_pool(): # Create a client - client = aiplatform_v1beta1.SpecialistPoolServiceClient() + client = aiplatform_v1beta1.SpecialistPoolServiceAsyncClient() # Initialize request argument(s) specialist_pool = aiplatform_v1beta1.SpecialistPool() @@ -259,7 +259,7 @@ def sample_create_specialist_pool(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -370,9 +370,9 @@ async def get_specialist_pool( from google.cloud import aiplatform_v1beta1 - def sample_get_specialist_pool(): + async def sample_get_specialist_pool(): # Create a client - client = aiplatform_v1beta1.SpecialistPoolServiceClient() + client = aiplatform_v1beta1.SpecialistPoolServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.GetSpecialistPoolRequest( @@ -380,7 +380,7 @@ def sample_get_specialist_pool(): ) # Make the request - response = client.get_specialist_pool(request=request) + response = await client.get_specialist_pool(request=request) # Handle the response print(response) @@ -476,9 +476,9 @@ async def list_specialist_pools( from google.cloud import aiplatform_v1beta1 - def sample_list_specialist_pools(): + async def sample_list_specialist_pools(): # Create a client - client = aiplatform_v1beta1.SpecialistPoolServiceClient() + client = aiplatform_v1beta1.SpecialistPoolServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.ListSpecialistPoolsRequest( @@ -489,7 +489,7 @@ def sample_list_specialist_pools(): page_result = client.list_specialist_pools(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -588,9 +588,9 @@ async def delete_specialist_pool( from google.cloud import aiplatform_v1beta1 - def sample_delete_specialist_pool(): + async def sample_delete_specialist_pool(): # Create a client - client = aiplatform_v1beta1.SpecialistPoolServiceClient() + client = aiplatform_v1beta1.SpecialistPoolServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.DeleteSpecialistPoolRequest( @@ -602,7 +602,7 @@ def sample_delete_specialist_pool(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -712,9 +712,9 @@ async def update_specialist_pool( from google.cloud import aiplatform_v1beta1 - def sample_update_specialist_pool(): + async def sample_update_specialist_pool(): # Create a client - client = aiplatform_v1beta1.SpecialistPoolServiceClient() + client = aiplatform_v1beta1.SpecialistPoolServiceAsyncClient() # Initialize request argument(s) specialist_pool = aiplatform_v1beta1.SpecialistPool() @@ -730,7 +730,7 @@ def sample_update_specialist_pool(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) diff --git a/google/cloud/aiplatform_v1beta1/services/tensorboard_service/async_client.py b/google/cloud/aiplatform_v1beta1/services/tensorboard_service/async_client.py index 94de444d8f..e2fd114daa 100644 --- a/google/cloud/aiplatform_v1beta1/services/tensorboard_service/async_client.py +++ b/google/cloud/aiplatform_v1beta1/services/tensorboard_service/async_client.py @@ -267,9 +267,9 @@ async def create_tensorboard( from google.cloud import aiplatform_v1beta1 - def sample_create_tensorboard(): + async def sample_create_tensorboard(): # Create a client - client = aiplatform_v1beta1.TensorboardServiceClient() + client = aiplatform_v1beta1.TensorboardServiceAsyncClient() # Initialize request argument(s) tensorboard = aiplatform_v1beta1.Tensorboard() @@ -285,7 +285,7 @@ def sample_create_tensorboard(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -390,9 +390,9 @@ async def get_tensorboard( from google.cloud import aiplatform_v1beta1 - def sample_get_tensorboard(): + async def sample_get_tensorboard(): # Create a client - client = aiplatform_v1beta1.TensorboardServiceClient() + client = aiplatform_v1beta1.TensorboardServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.GetTensorboardRequest( @@ -400,7 +400,7 @@ def sample_get_tensorboard(): ) # Make the request - response = client.get_tensorboard(request=request) + response = await client.get_tensorboard(request=request) # Handle the response print(response) @@ -490,9 +490,9 @@ async def update_tensorboard( from google.cloud import aiplatform_v1beta1 - def sample_update_tensorboard(): + async def sample_update_tensorboard(): # Create a client - client = aiplatform_v1beta1.TensorboardServiceClient() + client = aiplatform_v1beta1.TensorboardServiceAsyncClient() # Initialize request argument(s) tensorboard = aiplatform_v1beta1.Tensorboard() @@ -507,7 +507,7 @@ def sample_update_tensorboard(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -621,9 +621,9 @@ async def list_tensorboards( from google.cloud import aiplatform_v1beta1 - def sample_list_tensorboards(): + async def sample_list_tensorboards(): # Create a client - client = aiplatform_v1beta1.TensorboardServiceClient() + client = aiplatform_v1beta1.TensorboardServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.ListTensorboardsRequest( @@ -634,7 +634,7 @@ def sample_list_tensorboards(): page_result = client.list_tensorboards(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -730,9 +730,9 @@ async def delete_tensorboard( from google.cloud import aiplatform_v1beta1 - def sample_delete_tensorboard(): + async def sample_delete_tensorboard(): # Create a client - client = aiplatform_v1beta1.TensorboardServiceClient() + client = aiplatform_v1beta1.TensorboardServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.DeleteTensorboardRequest( @@ -744,7 +744,7 @@ def sample_delete_tensorboard(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -855,9 +855,9 @@ async def create_tensorboard_experiment( from google.cloud import aiplatform_v1beta1 - def sample_create_tensorboard_experiment(): + async def sample_create_tensorboard_experiment(): # Create a client - client = aiplatform_v1beta1.TensorboardServiceClient() + client = aiplatform_v1beta1.TensorboardServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.CreateTensorboardExperimentRequest( @@ -866,7 +866,7 @@ def sample_create_tensorboard_experiment(): ) # Make the request - response = client.create_tensorboard_experiment(request=request) + response = await client.create_tensorboard_experiment(request=request) # Handle the response print(response) @@ -978,9 +978,9 @@ async def get_tensorboard_experiment( from google.cloud import aiplatform_v1beta1 - def sample_get_tensorboard_experiment(): + async def sample_get_tensorboard_experiment(): # Create a client - client = aiplatform_v1beta1.TensorboardServiceClient() + client = aiplatform_v1beta1.TensorboardServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.GetTensorboardExperimentRequest( @@ -988,7 +988,7 @@ def sample_get_tensorboard_experiment(): ) # Make the request - response = client.get_tensorboard_experiment(request=request) + response = await client.get_tensorboard_experiment(request=request) # Handle the response print(response) @@ -1079,16 +1079,16 @@ async def update_tensorboard_experiment( from google.cloud import aiplatform_v1beta1 - def sample_update_tensorboard_experiment(): + async def sample_update_tensorboard_experiment(): # Create a client - client = aiplatform_v1beta1.TensorboardServiceClient() + client = aiplatform_v1beta1.TensorboardServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.UpdateTensorboardExperimentRequest( ) # Make the request - response = client.update_tensorboard_experiment(request=request) + response = await client.update_tensorboard_experiment(request=request) # Handle the response print(response) @@ -1195,9 +1195,9 @@ async def list_tensorboard_experiments( from google.cloud import aiplatform_v1beta1 - def sample_list_tensorboard_experiments(): + async def sample_list_tensorboard_experiments(): # Create a client - client = aiplatform_v1beta1.TensorboardServiceClient() + client = aiplatform_v1beta1.TensorboardServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.ListTensorboardExperimentsRequest( @@ -1208,7 +1208,7 @@ def sample_list_tensorboard_experiments(): page_result = client.list_tensorboard_experiments(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1307,9 +1307,9 @@ async def delete_tensorboard_experiment( from google.cloud import aiplatform_v1beta1 - def sample_delete_tensorboard_experiment(): + async def sample_delete_tensorboard_experiment(): # Create a client - client = aiplatform_v1beta1.TensorboardServiceClient() + client = aiplatform_v1beta1.TensorboardServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.DeleteTensorboardExperimentRequest( @@ -1321,7 +1321,7 @@ def sample_delete_tensorboard_experiment(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1430,9 +1430,9 @@ async def create_tensorboard_run( from google.cloud import aiplatform_v1beta1 - def sample_create_tensorboard_run(): + async def sample_create_tensorboard_run(): # Create a client - client = aiplatform_v1beta1.TensorboardServiceClient() + client = aiplatform_v1beta1.TensorboardServiceAsyncClient() # Initialize request argument(s) tensorboard_run = aiplatform_v1beta1.TensorboardRun() @@ -1445,7 +1445,7 @@ def sample_create_tensorboard_run(): ) # Make the request - response = client.create_tensorboard_run(request=request) + response = await client.create_tensorboard_run(request=request) # Handle the response print(response) @@ -1558,9 +1558,9 @@ async def batch_create_tensorboard_runs( from google.cloud import aiplatform_v1beta1 - def sample_batch_create_tensorboard_runs(): + async def sample_batch_create_tensorboard_runs(): # Create a client - client = aiplatform_v1beta1.TensorboardServiceClient() + client = aiplatform_v1beta1.TensorboardServiceAsyncClient() # Initialize request argument(s) requests = aiplatform_v1beta1.CreateTensorboardRunRequest() @@ -1574,7 +1574,7 @@ def sample_batch_create_tensorboard_runs(): ) # Make the request - response = client.batch_create_tensorboard_runs(request=request) + response = await client.batch_create_tensorboard_runs(request=request) # Handle the response print(response) @@ -1674,9 +1674,9 @@ async def get_tensorboard_run( from google.cloud import aiplatform_v1beta1 - def sample_get_tensorboard_run(): + async def sample_get_tensorboard_run(): # Create a client - client = aiplatform_v1beta1.TensorboardServiceClient() + client = aiplatform_v1beta1.TensorboardServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.GetTensorboardRunRequest( @@ -1684,7 +1684,7 @@ def sample_get_tensorboard_run(): ) # Make the request - response = client.get_tensorboard_run(request=request) + response = await client.get_tensorboard_run(request=request) # Handle the response print(response) @@ -1773,9 +1773,9 @@ async def update_tensorboard_run( from google.cloud import aiplatform_v1beta1 - def sample_update_tensorboard_run(): + async def sample_update_tensorboard_run(): # Create a client - client = aiplatform_v1beta1.TensorboardServiceClient() + client = aiplatform_v1beta1.TensorboardServiceAsyncClient() # Initialize request argument(s) tensorboard_run = aiplatform_v1beta1.TensorboardRun() @@ -1786,7 +1786,7 @@ def sample_update_tensorboard_run(): ) # Make the request - response = client.update_tensorboard_run(request=request) + response = await client.update_tensorboard_run(request=request) # Handle the response print(response) @@ -1890,9 +1890,9 @@ async def list_tensorboard_runs( from google.cloud import aiplatform_v1beta1 - def sample_list_tensorboard_runs(): + async def sample_list_tensorboard_runs(): # Create a client - client = aiplatform_v1beta1.TensorboardServiceClient() + client = aiplatform_v1beta1.TensorboardServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.ListTensorboardRunsRequest( @@ -1903,7 +1903,7 @@ def sample_list_tensorboard_runs(): page_result = client.list_tensorboard_runs(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -2000,9 +2000,9 @@ async def delete_tensorboard_run( from google.cloud import aiplatform_v1beta1 - def sample_delete_tensorboard_run(): + async def sample_delete_tensorboard_run(): # Create a client - client = aiplatform_v1beta1.TensorboardServiceClient() + client = aiplatform_v1beta1.TensorboardServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.DeleteTensorboardRunRequest( @@ -2014,7 +2014,7 @@ def sample_delete_tensorboard_run(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -2127,9 +2127,9 @@ async def batch_create_tensorboard_time_series( from google.cloud import aiplatform_v1beta1 - def sample_batch_create_tensorboard_time_series(): + async def sample_batch_create_tensorboard_time_series(): # Create a client - client = aiplatform_v1beta1.TensorboardServiceClient() + client = aiplatform_v1beta1.TensorboardServiceAsyncClient() # Initialize request argument(s) requests = aiplatform_v1beta1.CreateTensorboardTimeSeriesRequest() @@ -2143,7 +2143,7 @@ def sample_batch_create_tensorboard_time_series(): ) # Make the request - response = client.batch_create_tensorboard_time_series(request=request) + response = await client.batch_create_tensorboard_time_series(request=request) # Handle the response print(response) @@ -2247,9 +2247,9 @@ async def create_tensorboard_time_series( from google.cloud import aiplatform_v1beta1 - def sample_create_tensorboard_time_series(): + async def sample_create_tensorboard_time_series(): # Create a client - client = aiplatform_v1beta1.TensorboardServiceClient() + client = aiplatform_v1beta1.TensorboardServiceAsyncClient() # Initialize request argument(s) tensorboard_time_series = aiplatform_v1beta1.TensorboardTimeSeries() @@ -2262,7 +2262,7 @@ def sample_create_tensorboard_time_series(): ) # Make the request - response = client.create_tensorboard_time_series(request=request) + response = await client.create_tensorboard_time_series(request=request) # Handle the response print(response) @@ -2359,9 +2359,9 @@ async def get_tensorboard_time_series( from google.cloud import aiplatform_v1beta1 - def sample_get_tensorboard_time_series(): + async def sample_get_tensorboard_time_series(): # Create a client - client = aiplatform_v1beta1.TensorboardServiceClient() + client = aiplatform_v1beta1.TensorboardServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.GetTensorboardTimeSeriesRequest( @@ -2369,7 +2369,7 @@ def sample_get_tensorboard_time_series(): ) # Make the request - response = client.get_tensorboard_time_series(request=request) + response = await client.get_tensorboard_time_series(request=request) # Handle the response print(response) @@ -2458,9 +2458,9 @@ async def update_tensorboard_time_series( from google.cloud import aiplatform_v1beta1 - def sample_update_tensorboard_time_series(): + async def sample_update_tensorboard_time_series(): # Create a client - client = aiplatform_v1beta1.TensorboardServiceClient() + client = aiplatform_v1beta1.TensorboardServiceAsyncClient() # Initialize request argument(s) tensorboard_time_series = aiplatform_v1beta1.TensorboardTimeSeries() @@ -2472,7 +2472,7 @@ def sample_update_tensorboard_time_series(): ) # Make the request - response = client.update_tensorboard_time_series(request=request) + response = await client.update_tensorboard_time_series(request=request) # Handle the response print(response) @@ -2582,9 +2582,9 @@ async def list_tensorboard_time_series( from google.cloud import aiplatform_v1beta1 - def sample_list_tensorboard_time_series(): + async def sample_list_tensorboard_time_series(): # Create a client - client = aiplatform_v1beta1.TensorboardServiceClient() + client = aiplatform_v1beta1.TensorboardServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.ListTensorboardTimeSeriesRequest( @@ -2595,7 +2595,7 @@ def sample_list_tensorboard_time_series(): page_result = client.list_tensorboard_time_series(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -2694,9 +2694,9 @@ async def delete_tensorboard_time_series( from google.cloud import aiplatform_v1beta1 - def sample_delete_tensorboard_time_series(): + async def sample_delete_tensorboard_time_series(): # Create a client - client = aiplatform_v1beta1.TensorboardServiceClient() + client = aiplatform_v1beta1.TensorboardServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.DeleteTensorboardTimeSeriesRequest( @@ -2708,7 +2708,7 @@ def sample_delete_tensorboard_time_series(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -2822,9 +2822,9 @@ async def batch_read_tensorboard_time_series_data( from google.cloud import aiplatform_v1beta1 - def sample_batch_read_tensorboard_time_series_data(): + async def sample_batch_read_tensorboard_time_series_data(): # Create a client - client = aiplatform_v1beta1.TensorboardServiceClient() + client = aiplatform_v1beta1.TensorboardServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.BatchReadTensorboardTimeSeriesDataRequest( @@ -2833,7 +2833,7 @@ def sample_batch_read_tensorboard_time_series_data(): ) # Make the request - response = client.batch_read_tensorboard_time_series_data(request=request) + response = await client.batch_read_tensorboard_time_series_data(request=request) # Handle the response print(response) @@ -2931,9 +2931,9 @@ async def read_tensorboard_time_series_data( from google.cloud import aiplatform_v1beta1 - def sample_read_tensorboard_time_series_data(): + async def sample_read_tensorboard_time_series_data(): # Create a client - client = aiplatform_v1beta1.TensorboardServiceClient() + client = aiplatform_v1beta1.TensorboardServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.ReadTensorboardTimeSeriesDataRequest( @@ -2941,7 +2941,7 @@ def sample_read_tensorboard_time_series_data(): ) # Make the request - response = client.read_tensorboard_time_series_data(request=request) + response = await client.read_tensorboard_time_series_data(request=request) # Handle the response print(response) @@ -3032,9 +3032,9 @@ def read_tensorboard_blob_data( from google.cloud import aiplatform_v1beta1 - def sample_read_tensorboard_blob_data(): + async def sample_read_tensorboard_blob_data(): # Create a client - client = aiplatform_v1beta1.TensorboardServiceClient() + client = aiplatform_v1beta1.TensorboardServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.ReadTensorboardBlobDataRequest( @@ -3042,10 +3042,10 @@ def sample_read_tensorboard_blob_data(): ) # Make the request - stream = client.read_tensorboard_blob_data(request=request) + stream = await client.read_tensorboard_blob_data(request=request) # Handle the response - for response in stream: + async for response in stream: print(response) Args: @@ -3138,9 +3138,9 @@ async def write_tensorboard_experiment_data( from google.cloud import aiplatform_v1beta1 - def sample_write_tensorboard_experiment_data(): + async def sample_write_tensorboard_experiment_data(): # Create a client - client = aiplatform_v1beta1.TensorboardServiceClient() + client = aiplatform_v1beta1.TensorboardServiceAsyncClient() # Initialize request argument(s) write_run_data_requests = aiplatform_v1beta1.WriteTensorboardRunDataRequest() @@ -3154,7 +3154,7 @@ def sample_write_tensorboard_experiment_data(): ) # Make the request - response = client.write_tensorboard_experiment_data(request=request) + response = await client.write_tensorboard_experiment_data(request=request) # Handle the response print(response) @@ -3254,9 +3254,9 @@ async def write_tensorboard_run_data( from google.cloud import aiplatform_v1beta1 - def sample_write_tensorboard_run_data(): + async def sample_write_tensorboard_run_data(): # Create a client - client = aiplatform_v1beta1.TensorboardServiceClient() + client = aiplatform_v1beta1.TensorboardServiceAsyncClient() # Initialize request argument(s) time_series_data = aiplatform_v1beta1.TimeSeriesData() @@ -3269,7 +3269,7 @@ def sample_write_tensorboard_run_data(): ) # Make the request - response = client.write_tensorboard_run_data(request=request) + response = await client.write_tensorboard_run_data(request=request) # Handle the response print(response) @@ -3375,9 +3375,9 @@ async def export_tensorboard_time_series_data( from google.cloud import aiplatform_v1beta1 - def sample_export_tensorboard_time_series_data(): + async def sample_export_tensorboard_time_series_data(): # Create a client - client = aiplatform_v1beta1.TensorboardServiceClient() + client = aiplatform_v1beta1.TensorboardServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.ExportTensorboardTimeSeriesDataRequest( @@ -3388,7 +3388,7 @@ def sample_export_tensorboard_time_series_data(): page_result = client.export_tensorboard_time_series_data(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: diff --git a/google/cloud/aiplatform_v1beta1/services/vizier_service/async_client.py b/google/cloud/aiplatform_v1beta1/services/vizier_service/async_client.py index 517bfc30d9..d5cfd56262 100644 --- a/google/cloud/aiplatform_v1beta1/services/vizier_service/async_client.py +++ b/google/cloud/aiplatform_v1beta1/services/vizier_service/async_client.py @@ -232,9 +232,9 @@ async def create_study( from google.cloud import aiplatform_v1beta1 - def sample_create_study(): + async def sample_create_study(): # Create a client - client = aiplatform_v1beta1.VizierServiceClient() + client = aiplatform_v1beta1.VizierServiceAsyncClient() # Initialize request argument(s) study = aiplatform_v1beta1.Study() @@ -251,7 +251,7 @@ def sample_create_study(): ) # Make the request - response = client.create_study(request=request) + response = await client.create_study(request=request) # Handle the response print(response) @@ -344,9 +344,9 @@ async def get_study( from google.cloud import aiplatform_v1beta1 - def sample_get_study(): + async def sample_get_study(): # Create a client - client = aiplatform_v1beta1.VizierServiceClient() + client = aiplatform_v1beta1.VizierServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.GetStudyRequest( @@ -354,7 +354,7 @@ def sample_get_study(): ) # Make the request - response = client.get_study(request=request) + response = await client.get_study(request=request) # Handle the response print(response) @@ -438,9 +438,9 @@ async def list_studies( from google.cloud import aiplatform_v1beta1 - def sample_list_studies(): + async def sample_list_studies(): # Create a client - client = aiplatform_v1beta1.VizierServiceClient() + client = aiplatform_v1beta1.VizierServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.ListStudiesRequest( @@ -451,7 +451,7 @@ def sample_list_studies(): page_result = client.list_studies(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -547,9 +547,9 @@ async def delete_study( from google.cloud import aiplatform_v1beta1 - def sample_delete_study(): + async def sample_delete_study(): # Create a client - client = aiplatform_v1beta1.VizierServiceClient() + client = aiplatform_v1beta1.VizierServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.DeleteStudyRequest( @@ -557,7 +557,7 @@ def sample_delete_study(): ) # Make the request - client.delete_study(request=request) + await client.delete_study(request=request) Args: request (Union[google.cloud.aiplatform_v1beta1.types.DeleteStudyRequest, dict]): @@ -632,9 +632,9 @@ async def lookup_study( from google.cloud import aiplatform_v1beta1 - def sample_lookup_study(): + async def sample_lookup_study(): # Create a client - client = aiplatform_v1beta1.VizierServiceClient() + client = aiplatform_v1beta1.VizierServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.LookupStudyRequest( @@ -643,7 +643,7 @@ def sample_lookup_study(): ) # Make the request - response = client.lookup_study(request=request) + response = await client.lookup_study(request=request) # Handle the response print(response) @@ -730,9 +730,9 @@ async def suggest_trials( from google.cloud import aiplatform_v1beta1 - def sample_suggest_trials(): + async def sample_suggest_trials(): # Create a client - client = aiplatform_v1beta1.VizierServiceClient() + client = aiplatform_v1beta1.VizierServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.SuggestTrialsRequest( @@ -746,7 +746,7 @@ def sample_suggest_trials(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -823,9 +823,9 @@ async def create_trial( from google.cloud import aiplatform_v1beta1 - def sample_create_trial(): + async def sample_create_trial(): # Create a client - client = aiplatform_v1beta1.VizierServiceClient() + client = aiplatform_v1beta1.VizierServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.CreateTrialRequest( @@ -833,7 +833,7 @@ def sample_create_trial(): ) # Make the request - response = client.create_trial(request=request) + response = await client.create_trial(request=request) # Handle the response print(response) @@ -929,9 +929,9 @@ async def get_trial( from google.cloud import aiplatform_v1beta1 - def sample_get_trial(): + async def sample_get_trial(): # Create a client - client = aiplatform_v1beta1.VizierServiceClient() + client = aiplatform_v1beta1.VizierServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.GetTrialRequest( @@ -939,7 +939,7 @@ def sample_get_trial(): ) # Make the request - response = client.get_trial(request=request) + response = await client.get_trial(request=request) # Handle the response print(response) @@ -1027,9 +1027,9 @@ async def list_trials( from google.cloud import aiplatform_v1beta1 - def sample_list_trials(): + async def sample_list_trials(): # Create a client - client = aiplatform_v1beta1.VizierServiceClient() + client = aiplatform_v1beta1.VizierServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.ListTrialsRequest( @@ -1040,7 +1040,7 @@ def sample_list_trials(): page_result = client.list_trials(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1137,9 +1137,9 @@ async def add_trial_measurement( from google.cloud import aiplatform_v1beta1 - def sample_add_trial_measurement(): + async def sample_add_trial_measurement(): # Create a client - client = aiplatform_v1beta1.VizierServiceClient() + client = aiplatform_v1beta1.VizierServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.AddTrialMeasurementRequest( @@ -1147,7 +1147,7 @@ def sample_add_trial_measurement(): ) # Make the request - response = client.add_trial_measurement(request=request) + response = await client.add_trial_measurement(request=request) # Handle the response print(response) @@ -1215,9 +1215,9 @@ async def complete_trial( from google.cloud import aiplatform_v1beta1 - def sample_complete_trial(): + async def sample_complete_trial(): # Create a client - client = aiplatform_v1beta1.VizierServiceClient() + client = aiplatform_v1beta1.VizierServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.CompleteTrialRequest( @@ -1225,7 +1225,7 @@ def sample_complete_trial(): ) # Make the request - response = client.complete_trial(request=request) + response = await client.complete_trial(request=request) # Handle the response print(response) @@ -1292,9 +1292,9 @@ async def delete_trial( from google.cloud import aiplatform_v1beta1 - def sample_delete_trial(): + async def sample_delete_trial(): # Create a client - client = aiplatform_v1beta1.VizierServiceClient() + client = aiplatform_v1beta1.VizierServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.DeleteTrialRequest( @@ -1302,7 +1302,7 @@ def sample_delete_trial(): ) # Make the request - client.delete_trial(request=request) + await client.delete_trial(request=request) Args: request (Union[google.cloud.aiplatform_v1beta1.types.DeleteTrialRequest, dict]): @@ -1377,9 +1377,9 @@ async def check_trial_early_stopping_state( from google.cloud import aiplatform_v1beta1 - def sample_check_trial_early_stopping_state(): + async def sample_check_trial_early_stopping_state(): # Create a client - client = aiplatform_v1beta1.VizierServiceClient() + client = aiplatform_v1beta1.VizierServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.CheckTrialEarlyStoppingStateRequest( @@ -1391,7 +1391,7 @@ def sample_check_trial_early_stopping_state(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1468,9 +1468,9 @@ async def stop_trial( from google.cloud import aiplatform_v1beta1 - def sample_stop_trial(): + async def sample_stop_trial(): # Create a client - client = aiplatform_v1beta1.VizierServiceClient() + client = aiplatform_v1beta1.VizierServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.StopTrialRequest( @@ -1478,7 +1478,7 @@ def sample_stop_trial(): ) # Make the request - response = client.stop_trial(request=request) + response = await client.stop_trial(request=request) # Handle the response print(response) @@ -1548,9 +1548,9 @@ async def list_optimal_trials( from google.cloud import aiplatform_v1beta1 - def sample_list_optimal_trials(): + async def sample_list_optimal_trials(): # Create a client - client = aiplatform_v1beta1.VizierServiceClient() + client = aiplatform_v1beta1.VizierServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.ListOptimalTrialsRequest( @@ -1558,7 +1558,7 @@ def sample_list_optimal_trials(): ) # Make the request - response = client.list_optimal_trials(request=request) + response = await client.list_optimal_trials(request=request) # Handle the response print(response) diff --git a/google/cloud/aiplatform_v1beta1/types/__init__.py b/google/cloud/aiplatform_v1beta1/types/__init__.py index 7951d5ca8c..be1d312971 100644 --- a/google/cloud/aiplatform_v1beta1/types/__init__.py +++ b/google/cloud/aiplatform_v1beta1/types/__init__.py @@ -428,6 +428,7 @@ PipelineJobDetail, PipelineTaskDetail, PipelineTaskExecutorDetail, + PipelineTemplateMetadata, ) from .pipeline_service import ( CancelPipelineJobRequest, @@ -897,6 +898,7 @@ "PipelineJobDetail", "PipelineTaskDetail", "PipelineTaskExecutorDetail", + "PipelineTemplateMetadata", "CancelPipelineJobRequest", "CancelTrainingPipelineRequest", "CreatePipelineJobRequest", diff --git a/google/cloud/aiplatform_v1beta1/types/pipeline_job.py b/google/cloud/aiplatform_v1beta1/types/pipeline_job.py index 3a79d4ec07..a43e876a5f 100644 --- a/google/cloud/aiplatform_v1beta1/types/pipeline_job.py +++ b/google/cloud/aiplatform_v1beta1/types/pipeline_job.py @@ -30,6 +30,7 @@ package="google.cloud.aiplatform.v1beta1", manifest={ "PipelineJob", + "PipelineTemplateMetadata", "PipelineJobDetail", "PipelineTaskDetail", "PipelineTaskExecutorDetail", @@ -109,6 +110,15 @@ class PipelineJob(proto.Message): to the GCP resources being launched, if applied, such as Vertex AI Training or Dataflow job. If left unspecified, the workload is not peered with any network. + template_uri (str): + A template uri from where the + [PipelineJob.pipeline_spec][google.cloud.aiplatform.v1beta1.PipelineJob.pipeline_spec], + if empty, will be downloaded. + template_metadata (google.cloud.aiplatform_v1beta1.types.PipelineTemplateMetadata): + Output only. Pipeline template metadata. Will fill up fields + if + [PipelineJob.template_uri][google.cloud.aiplatform.v1beta1.PipelineJob.template_uri] + is from supported template registry. """ class RuntimeConfig(proto.Message): @@ -234,6 +244,38 @@ class RuntimeConfig(proto.Message): proto.STRING, number=18, ) + template_uri = proto.Field( + proto.STRING, + number=19, + ) + template_metadata = proto.Field( + proto.MESSAGE, + number=20, + message="PipelineTemplateMetadata", + ) + + +class PipelineTemplateMetadata(proto.Message): + r"""Pipeline template metadata if + [PipelineJob.template_uri][google.cloud.aiplatform.v1beta1.PipelineJob.template_uri] + is from supported template registry. Currently, the only supported + registry is Artifact Registry. + + Attributes: + version (str): + The version_name in artifact registry. + + Will always be presented in output if the + [PipelineJob.template_uri][google.cloud.aiplatform.v1beta1.PipelineJob.template_uri] + is from supported template registry. + + Format is "sha256:abcdef123456...". + """ + + version = proto.Field( + proto.STRING, + number=3, + ) class PipelineJobDetail(proto.Message): diff --git a/tests/unit/gapic/aiplatform_v1/test_dataset_service.py b/tests/unit/gapic/aiplatform_v1/test_dataset_service.py index 76356d74c9..f46c4ec2e1 100644 --- a/tests/unit/gapic/aiplatform_v1/test_dataset_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_dataset_service.py @@ -755,7 +755,7 @@ def test_create_dataset_field_headers(): # a field header. Set these to a non-empty value. request = dataset_service.CreateDatasetRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_dataset), "__call__") as call: @@ -771,7 +771,7 @@ def test_create_dataset_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -785,7 +785,7 @@ async def test_create_dataset_field_headers_async(): # a field header. Set these to a non-empty value. request = dataset_service.CreateDatasetRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_dataset), "__call__") as call: @@ -803,7 +803,7 @@ async def test_create_dataset_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1013,7 +1013,7 @@ def test_get_dataset_field_headers(): # a field header. Set these to a non-empty value. request = dataset_service.GetDatasetRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_dataset), "__call__") as call: @@ -1029,7 +1029,7 @@ def test_get_dataset_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1043,7 +1043,7 @@ async def test_get_dataset_field_headers_async(): # a field header. Set these to a non-empty value. request = dataset_service.GetDatasetRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_dataset), "__call__") as call: @@ -1059,7 +1059,7 @@ async def test_get_dataset_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1257,7 +1257,7 @@ def test_update_dataset_field_headers(): # a field header. Set these to a non-empty value. request = dataset_service.UpdateDatasetRequest() - request.dataset.name = "dataset.name/value" + request.dataset.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_dataset), "__call__") as call: @@ -1273,7 +1273,7 @@ def test_update_dataset_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "dataset.name=dataset.name/value", + "dataset.name=name_value", ) in kw["metadata"] @@ -1287,7 +1287,7 @@ async def test_update_dataset_field_headers_async(): # a field header. Set these to a non-empty value. request = dataset_service.UpdateDatasetRequest() - request.dataset.name = "dataset.name/value" + request.dataset.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_dataset), "__call__") as call: @@ -1303,7 +1303,7 @@ async def test_update_dataset_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "dataset.name=dataset.name/value", + "dataset.name=name_value", ) in kw["metadata"] @@ -1495,7 +1495,7 @@ def test_list_datasets_field_headers(): # a field header. Set these to a non-empty value. request = dataset_service.ListDatasetsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_datasets), "__call__") as call: @@ -1511,7 +1511,7 @@ def test_list_datasets_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1525,7 +1525,7 @@ async def test_list_datasets_field_headers_async(): # a field header. Set these to a non-empty value. request = dataset_service.ListDatasetsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_datasets), "__call__") as call: @@ -1543,7 +1543,7 @@ async def test_list_datasets_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1674,7 +1674,7 @@ def test_list_datasets_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, dataset.Dataset) for i in results) @@ -1909,7 +1909,7 @@ def test_delete_dataset_field_headers(): # a field header. Set these to a non-empty value. request = dataset_service.DeleteDatasetRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_dataset), "__call__") as call: @@ -1925,7 +1925,7 @@ def test_delete_dataset_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1939,7 +1939,7 @@ async def test_delete_dataset_field_headers_async(): # a field header. Set these to a non-empty value. request = dataset_service.DeleteDatasetRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_dataset), "__call__") as call: @@ -1957,7 +1957,7 @@ async def test_delete_dataset_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2135,7 +2135,7 @@ def test_import_data_field_headers(): # a field header. Set these to a non-empty value. request = dataset_service.ImportDataRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.import_data), "__call__") as call: @@ -2151,7 +2151,7 @@ def test_import_data_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2165,7 +2165,7 @@ async def test_import_data_field_headers_async(): # a field header. Set these to a non-empty value. request = dataset_service.ImportDataRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.import_data), "__call__") as call: @@ -2183,7 +2183,7 @@ async def test_import_data_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2383,7 +2383,7 @@ def test_export_data_field_headers(): # a field header. Set these to a non-empty value. request = dataset_service.ExportDataRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.export_data), "__call__") as call: @@ -2399,7 +2399,7 @@ def test_export_data_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2413,7 +2413,7 @@ async def test_export_data_field_headers_async(): # a field header. Set these to a non-empty value. request = dataset_service.ExportDataRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.export_data), "__call__") as call: @@ -2431,7 +2431,7 @@ async def test_export_data_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2649,7 +2649,7 @@ def test_list_data_items_field_headers(): # a field header. Set these to a non-empty value. request = dataset_service.ListDataItemsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_data_items), "__call__") as call: @@ -2665,7 +2665,7 @@ def test_list_data_items_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2679,7 +2679,7 @@ async def test_list_data_items_field_headers_async(): # a field header. Set these to a non-empty value. request = dataset_service.ListDataItemsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_data_items), "__call__") as call: @@ -2697,7 +2697,7 @@ async def test_list_data_items_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2828,7 +2828,7 @@ def test_list_data_items_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, data_item.DataItem) for i in results) @@ -3084,7 +3084,7 @@ def test_get_annotation_spec_field_headers(): # a field header. Set these to a non-empty value. request = dataset_service.GetAnnotationSpecRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3102,7 +3102,7 @@ def test_get_annotation_spec_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3116,7 +3116,7 @@ async def test_get_annotation_spec_field_headers_async(): # a field header. Set these to a non-empty value. request = dataset_service.GetAnnotationSpecRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3136,7 +3136,7 @@ async def test_get_annotation_spec_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3324,7 +3324,7 @@ def test_list_annotations_field_headers(): # a field header. Set these to a non-empty value. request = dataset_service.ListAnnotationsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_annotations), "__call__") as call: @@ -3340,7 +3340,7 @@ def test_list_annotations_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3354,7 +3354,7 @@ async def test_list_annotations_field_headers_async(): # a field header. Set these to a non-empty value. request = dataset_service.ListAnnotationsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_annotations), "__call__") as call: @@ -3372,7 +3372,7 @@ async def test_list_annotations_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3503,7 +3503,7 @@ def test_list_annotations_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, annotation.Annotation) for i in results) diff --git a/tests/unit/gapic/aiplatform_v1/test_endpoint_service.py b/tests/unit/gapic/aiplatform_v1/test_endpoint_service.py index 88b52d3ec2..7a6b3792af 100644 --- a/tests/unit/gapic/aiplatform_v1/test_endpoint_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_endpoint_service.py @@ -770,7 +770,7 @@ def test_create_endpoint_field_headers(): # a field header. Set these to a non-empty value. request = endpoint_service.CreateEndpointRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_endpoint), "__call__") as call: @@ -786,7 +786,7 @@ def test_create_endpoint_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -800,7 +800,7 @@ async def test_create_endpoint_field_headers_async(): # a field header. Set these to a non-empty value. request = endpoint_service.CreateEndpointRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_endpoint), "__call__") as call: @@ -818,7 +818,7 @@ async def test_create_endpoint_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1052,7 +1052,7 @@ def test_get_endpoint_field_headers(): # a field header. Set these to a non-empty value. request = endpoint_service.GetEndpointRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_endpoint), "__call__") as call: @@ -1068,7 +1068,7 @@ def test_get_endpoint_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1082,7 +1082,7 @@ async def test_get_endpoint_field_headers_async(): # a field header. Set these to a non-empty value. request = endpoint_service.GetEndpointRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_endpoint), "__call__") as call: @@ -1098,7 +1098,7 @@ async def test_get_endpoint_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1280,7 +1280,7 @@ def test_list_endpoints_field_headers(): # a field header. Set these to a non-empty value. request = endpoint_service.ListEndpointsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_endpoints), "__call__") as call: @@ -1296,7 +1296,7 @@ def test_list_endpoints_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1310,7 +1310,7 @@ async def test_list_endpoints_field_headers_async(): # a field header. Set these to a non-empty value. request = endpoint_service.ListEndpointsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_endpoints), "__call__") as call: @@ -1328,7 +1328,7 @@ async def test_list_endpoints_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1459,7 +1459,7 @@ def test_list_endpoints_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, endpoint.Endpoint) for i in results) @@ -1730,7 +1730,7 @@ def test_update_endpoint_field_headers(): # a field header. Set these to a non-empty value. request = endpoint_service.UpdateEndpointRequest() - request.endpoint.name = "endpoint.name/value" + request.endpoint.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_endpoint), "__call__") as call: @@ -1746,7 +1746,7 @@ def test_update_endpoint_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "endpoint.name=endpoint.name/value", + "endpoint.name=name_value", ) in kw["metadata"] @@ -1760,7 +1760,7 @@ async def test_update_endpoint_field_headers_async(): # a field header. Set these to a non-empty value. request = endpoint_service.UpdateEndpointRequest() - request.endpoint.name = "endpoint.name/value" + request.endpoint.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_endpoint), "__call__") as call: @@ -1778,7 +1778,7 @@ async def test_update_endpoint_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "endpoint.name=endpoint.name/value", + "endpoint.name=name_value", ) in kw["metadata"] @@ -1966,7 +1966,7 @@ def test_delete_endpoint_field_headers(): # a field header. Set these to a non-empty value. request = endpoint_service.DeleteEndpointRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_endpoint), "__call__") as call: @@ -1982,7 +1982,7 @@ def test_delete_endpoint_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1996,7 +1996,7 @@ async def test_delete_endpoint_field_headers_async(): # a field header. Set these to a non-empty value. request = endpoint_service.DeleteEndpointRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_endpoint), "__call__") as call: @@ -2014,7 +2014,7 @@ async def test_delete_endpoint_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2192,7 +2192,7 @@ def test_deploy_model_field_headers(): # a field header. Set these to a non-empty value. request = endpoint_service.DeployModelRequest() - request.endpoint = "endpoint/value" + request.endpoint = "endpoint_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.deploy_model), "__call__") as call: @@ -2208,7 +2208,7 @@ def test_deploy_model_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "endpoint=endpoint/value", + "endpoint=endpoint_value", ) in kw["metadata"] @@ -2222,7 +2222,7 @@ async def test_deploy_model_field_headers_async(): # a field header. Set these to a non-empty value. request = endpoint_service.DeployModelRequest() - request.endpoint = "endpoint/value" + request.endpoint = "endpoint_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.deploy_model), "__call__") as call: @@ -2240,7 +2240,7 @@ async def test_deploy_model_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "endpoint=endpoint/value", + "endpoint=endpoint_value", ) in kw["metadata"] @@ -2474,7 +2474,7 @@ def test_undeploy_model_field_headers(): # a field header. Set these to a non-empty value. request = endpoint_service.UndeployModelRequest() - request.endpoint = "endpoint/value" + request.endpoint = "endpoint_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.undeploy_model), "__call__") as call: @@ -2490,7 +2490,7 @@ def test_undeploy_model_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "endpoint=endpoint/value", + "endpoint=endpoint_value", ) in kw["metadata"] @@ -2504,7 +2504,7 @@ async def test_undeploy_model_field_headers_async(): # a field header. Set these to a non-empty value. request = endpoint_service.UndeployModelRequest() - request.endpoint = "endpoint/value" + request.endpoint = "endpoint_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.undeploy_model), "__call__") as call: @@ -2522,7 +2522,7 @@ async def test_undeploy_model_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "endpoint=endpoint/value", + "endpoint=endpoint_value", ) in kw["metadata"] diff --git a/tests/unit/gapic/aiplatform_v1/test_featurestore_online_serving_service.py b/tests/unit/gapic/aiplatform_v1/test_featurestore_online_serving_service.py index 5ddc6ed984..906e745604 100644 --- a/tests/unit/gapic/aiplatform_v1/test_featurestore_online_serving_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_featurestore_online_serving_service.py @@ -794,7 +794,7 @@ def test_read_feature_values_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_online_service.ReadFeatureValuesRequest() - request.entity_type = "entity_type/value" + request.entity_type = "entity_type_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -812,7 +812,7 @@ def test_read_feature_values_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "entity_type=entity_type/value", + "entity_type=entity_type_value", ) in kw["metadata"] @@ -826,7 +826,7 @@ async def test_read_feature_values_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_online_service.ReadFeatureValuesRequest() - request.entity_type = "entity_type/value" + request.entity_type = "entity_type_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -846,7 +846,7 @@ async def test_read_feature_values_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "entity_type=entity_type/value", + "entity_type=entity_type_value", ) in kw["metadata"] @@ -1048,7 +1048,7 @@ def test_streaming_read_feature_values_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_online_service.StreamingReadFeatureValuesRequest() - request.entity_type = "entity_type/value" + request.entity_type = "entity_type_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1068,7 +1068,7 @@ def test_streaming_read_feature_values_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "entity_type=entity_type/value", + "entity_type=entity_type_value", ) in kw["metadata"] @@ -1082,7 +1082,7 @@ async def test_streaming_read_feature_values_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_online_service.StreamingReadFeatureValuesRequest() - request.entity_type = "entity_type/value" + request.entity_type = "entity_type_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1103,7 +1103,7 @@ async def test_streaming_read_feature_values_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "entity_type=entity_type/value", + "entity_type=entity_type_value", ) in kw["metadata"] diff --git a/tests/unit/gapic/aiplatform_v1/test_featurestore_service.py b/tests/unit/gapic/aiplatform_v1/test_featurestore_service.py index 375facda4f..ac236b5eb5 100644 --- a/tests/unit/gapic/aiplatform_v1/test_featurestore_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_featurestore_service.py @@ -790,7 +790,7 @@ def test_create_featurestore_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_service.CreateFeaturestoreRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -808,7 +808,7 @@ def test_create_featurestore_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -822,7 +822,7 @@ async def test_create_featurestore_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_service.CreateFeaturestoreRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -842,7 +842,7 @@ async def test_create_featurestore_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1059,7 +1059,7 @@ def test_get_featurestore_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_service.GetFeaturestoreRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_featurestore), "__call__") as call: @@ -1075,7 +1075,7 @@ def test_get_featurestore_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1089,7 +1089,7 @@ async def test_get_featurestore_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_service.GetFeaturestoreRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_featurestore), "__call__") as call: @@ -1107,7 +1107,7 @@ async def test_get_featurestore_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1298,7 +1298,7 @@ def test_list_featurestores_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_service.ListFeaturestoresRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1316,7 +1316,7 @@ def test_list_featurestores_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1330,7 +1330,7 @@ async def test_list_featurestores_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_service.ListFeaturestoresRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1350,7 +1350,7 @@ async def test_list_featurestores_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1487,7 +1487,7 @@ def test_list_featurestores_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, featurestore.Featurestore) for i in results) @@ -1735,7 +1735,7 @@ def test_update_featurestore_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_service.UpdateFeaturestoreRequest() - request.featurestore.name = "featurestore.name/value" + request.featurestore.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1753,7 +1753,7 @@ def test_update_featurestore_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "featurestore.name=featurestore.name/value", + "featurestore.name=name_value", ) in kw["metadata"] @@ -1767,7 +1767,7 @@ async def test_update_featurestore_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_service.UpdateFeaturestoreRequest() - request.featurestore.name = "featurestore.name/value" + request.featurestore.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1787,7 +1787,7 @@ async def test_update_featurestore_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "featurestore.name=featurestore.name/value", + "featurestore.name=name_value", ) in kw["metadata"] @@ -1986,7 +1986,7 @@ def test_delete_featurestore_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_service.DeleteFeaturestoreRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2004,7 +2004,7 @@ def test_delete_featurestore_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2018,7 +2018,7 @@ async def test_delete_featurestore_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_service.DeleteFeaturestoreRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2038,7 +2038,7 @@ async def test_delete_featurestore_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2237,7 +2237,7 @@ def test_create_entity_type_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_service.CreateEntityTypeRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2255,7 +2255,7 @@ def test_create_entity_type_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2269,7 +2269,7 @@ async def test_create_entity_type_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_service.CreateEntityTypeRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2289,7 +2289,7 @@ async def test_create_entity_type_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2506,7 +2506,7 @@ def test_get_entity_type_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_service.GetEntityTypeRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_entity_type), "__call__") as call: @@ -2522,7 +2522,7 @@ def test_get_entity_type_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2536,7 +2536,7 @@ async def test_get_entity_type_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_service.GetEntityTypeRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_entity_type), "__call__") as call: @@ -2554,7 +2554,7 @@ async def test_get_entity_type_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2745,7 +2745,7 @@ def test_list_entity_types_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_service.ListEntityTypesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2763,7 +2763,7 @@ def test_list_entity_types_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2777,7 +2777,7 @@ async def test_list_entity_types_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_service.ListEntityTypesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2797,7 +2797,7 @@ async def test_list_entity_types_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2934,7 +2934,7 @@ def test_list_entity_types_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, entity_type.EntityType) for i in results) @@ -3196,7 +3196,7 @@ def test_update_entity_type_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_service.UpdateEntityTypeRequest() - request.entity_type.name = "entity_type.name/value" + request.entity_type.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3214,7 +3214,7 @@ def test_update_entity_type_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "entity_type.name=entity_type.name/value", + "entity_type.name=name_value", ) in kw["metadata"] @@ -3228,7 +3228,7 @@ async def test_update_entity_type_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_service.UpdateEntityTypeRequest() - request.entity_type.name = "entity_type.name/value" + request.entity_type.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3248,7 +3248,7 @@ async def test_update_entity_type_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "entity_type.name=entity_type.name/value", + "entity_type.name=name_value", ) in kw["metadata"] @@ -3447,7 +3447,7 @@ def test_delete_entity_type_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_service.DeleteEntityTypeRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3465,7 +3465,7 @@ def test_delete_entity_type_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3479,7 +3479,7 @@ async def test_delete_entity_type_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_service.DeleteEntityTypeRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3499,7 +3499,7 @@ async def test_delete_entity_type_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3692,7 +3692,7 @@ def test_create_feature_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_service.CreateFeatureRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_feature), "__call__") as call: @@ -3708,7 +3708,7 @@ def test_create_feature_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3722,7 +3722,7 @@ async def test_create_feature_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_service.CreateFeatureRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_feature), "__call__") as call: @@ -3740,7 +3740,7 @@ async def test_create_feature_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3945,7 +3945,7 @@ def test_batch_create_features_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_service.BatchCreateFeaturesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3963,7 +3963,7 @@ def test_batch_create_features_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3977,7 +3977,7 @@ async def test_batch_create_features_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_service.BatchCreateFeaturesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3997,7 +3997,7 @@ async def test_batch_create_features_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4211,7 +4211,7 @@ def test_get_feature_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_service.GetFeatureRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_feature), "__call__") as call: @@ -4227,7 +4227,7 @@ def test_get_feature_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4241,7 +4241,7 @@ async def test_get_feature_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_service.GetFeatureRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_feature), "__call__") as call: @@ -4257,7 +4257,7 @@ async def test_get_feature_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4440,7 +4440,7 @@ def test_list_features_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_service.ListFeaturesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_features), "__call__") as call: @@ -4456,7 +4456,7 @@ def test_list_features_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4470,7 +4470,7 @@ async def test_list_features_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_service.ListFeaturesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_features), "__call__") as call: @@ -4488,7 +4488,7 @@ async def test_list_features_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4619,7 +4619,7 @@ def test_list_features_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, feature.Feature) for i in results) @@ -4877,7 +4877,7 @@ def test_update_feature_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_service.UpdateFeatureRequest() - request.feature.name = "feature.name/value" + request.feature.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_feature), "__call__") as call: @@ -4893,7 +4893,7 @@ def test_update_feature_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "feature.name=feature.name/value", + "feature.name=name_value", ) in kw["metadata"] @@ -4907,7 +4907,7 @@ async def test_update_feature_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_service.UpdateFeatureRequest() - request.feature.name = "feature.name/value" + request.feature.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_feature), "__call__") as call: @@ -4923,7 +4923,7 @@ async def test_update_feature_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "feature.name=feature.name/value", + "feature.name=name_value", ) in kw["metadata"] @@ -5110,7 +5110,7 @@ def test_delete_feature_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_service.DeleteFeatureRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_feature), "__call__") as call: @@ -5126,7 +5126,7 @@ def test_delete_feature_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5140,7 +5140,7 @@ async def test_delete_feature_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_service.DeleteFeatureRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_feature), "__call__") as call: @@ -5158,7 +5158,7 @@ async def test_delete_feature_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5343,7 +5343,7 @@ def test_import_feature_values_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_service.ImportFeatureValuesRequest() - request.entity_type = "entity_type/value" + request.entity_type = "entity_type_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5361,7 +5361,7 @@ def test_import_feature_values_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "entity_type=entity_type/value", + "entity_type=entity_type_value", ) in kw["metadata"] @@ -5375,7 +5375,7 @@ async def test_import_feature_values_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_service.ImportFeatureValuesRequest() - request.entity_type = "entity_type/value" + request.entity_type = "entity_type_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5395,7 +5395,7 @@ async def test_import_feature_values_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "entity_type=entity_type/value", + "entity_type=entity_type_value", ) in kw["metadata"] @@ -5584,7 +5584,7 @@ def test_batch_read_feature_values_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_service.BatchReadFeatureValuesRequest() - request.featurestore = "featurestore/value" + request.featurestore = "featurestore_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5602,7 +5602,7 @@ def test_batch_read_feature_values_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "featurestore=featurestore/value", + "featurestore=featurestore_value", ) in kw["metadata"] @@ -5616,7 +5616,7 @@ async def test_batch_read_feature_values_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_service.BatchReadFeatureValuesRequest() - request.featurestore = "featurestore/value" + request.featurestore = "featurestore_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5636,7 +5636,7 @@ async def test_batch_read_feature_values_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "featurestore=featurestore/value", + "featurestore=featurestore_value", ) in kw["metadata"] @@ -5825,7 +5825,7 @@ def test_export_feature_values_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_service.ExportFeatureValuesRequest() - request.entity_type = "entity_type/value" + request.entity_type = "entity_type_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5843,7 +5843,7 @@ def test_export_feature_values_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "entity_type=entity_type/value", + "entity_type=entity_type_value", ) in kw["metadata"] @@ -5857,7 +5857,7 @@ async def test_export_feature_values_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_service.ExportFeatureValuesRequest() - request.entity_type = "entity_type/value" + request.entity_type = "entity_type_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5877,7 +5877,7 @@ async def test_export_feature_values_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "entity_type=entity_type/value", + "entity_type=entity_type_value", ) in kw["metadata"] @@ -6066,7 +6066,7 @@ def test_search_features_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_service.SearchFeaturesRequest() - request.location = "location/value" + request.location = "location_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.search_features), "__call__") as call: @@ -6082,7 +6082,7 @@ def test_search_features_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "location=location/value", + "location=location_value", ) in kw["metadata"] @@ -6096,7 +6096,7 @@ async def test_search_features_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_service.SearchFeaturesRequest() - request.location = "location/value" + request.location = "location_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.search_features), "__call__") as call: @@ -6114,7 +6114,7 @@ async def test_search_features_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "location=location/value", + "location=location_value", ) in kw["metadata"] @@ -6255,7 +6255,7 @@ def test_search_features_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, feature.Feature) for i in results) diff --git a/tests/unit/gapic/aiplatform_v1/test_index_endpoint_service.py b/tests/unit/gapic/aiplatform_v1/test_index_endpoint_service.py index e42233265c..3a2f967be0 100644 --- a/tests/unit/gapic/aiplatform_v1/test_index_endpoint_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_index_endpoint_service.py @@ -783,7 +783,7 @@ def test_create_index_endpoint_field_headers(): # a field header. Set these to a non-empty value. request = index_endpoint_service.CreateIndexEndpointRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -801,7 +801,7 @@ def test_create_index_endpoint_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -815,7 +815,7 @@ async def test_create_index_endpoint_field_headers_async(): # a field header. Set these to a non-empty value. request = index_endpoint_service.CreateIndexEndpointRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -835,7 +835,7 @@ async def test_create_index_endpoint_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1060,7 +1060,7 @@ def test_get_index_endpoint_field_headers(): # a field header. Set these to a non-empty value. request = index_endpoint_service.GetIndexEndpointRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1078,7 +1078,7 @@ def test_get_index_endpoint_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1092,7 +1092,7 @@ async def test_get_index_endpoint_field_headers_async(): # a field header. Set these to a non-empty value. request = index_endpoint_service.GetIndexEndpointRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1112,7 +1112,7 @@ async def test_get_index_endpoint_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1307,7 +1307,7 @@ def test_list_index_endpoints_field_headers(): # a field header. Set these to a non-empty value. request = index_endpoint_service.ListIndexEndpointsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1325,7 +1325,7 @@ def test_list_index_endpoints_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1339,7 +1339,7 @@ async def test_list_index_endpoints_field_headers_async(): # a field header. Set these to a non-empty value. request = index_endpoint_service.ListIndexEndpointsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1359,7 +1359,7 @@ async def test_list_index_endpoints_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1496,7 +1496,7 @@ def test_list_index_endpoints_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, index_endpoint.IndexEndpoint) for i in results) @@ -1770,7 +1770,7 @@ def test_update_index_endpoint_field_headers(): # a field header. Set these to a non-empty value. request = index_endpoint_service.UpdateIndexEndpointRequest() - request.index_endpoint.name = "index_endpoint.name/value" + request.index_endpoint.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1788,7 +1788,7 @@ def test_update_index_endpoint_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "index_endpoint.name=index_endpoint.name/value", + "index_endpoint.name=name_value", ) in kw["metadata"] @@ -1802,7 +1802,7 @@ async def test_update_index_endpoint_field_headers_async(): # a field header. Set these to a non-empty value. request = index_endpoint_service.UpdateIndexEndpointRequest() - request.index_endpoint.name = "index_endpoint.name/value" + request.index_endpoint.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1822,7 +1822,7 @@ async def test_update_index_endpoint_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "index_endpoint.name=index_endpoint.name/value", + "index_endpoint.name=name_value", ) in kw["metadata"] @@ -2021,7 +2021,7 @@ def test_delete_index_endpoint_field_headers(): # a field header. Set these to a non-empty value. request = index_endpoint_service.DeleteIndexEndpointRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2039,7 +2039,7 @@ def test_delete_index_endpoint_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2053,7 +2053,7 @@ async def test_delete_index_endpoint_field_headers_async(): # a field header. Set these to a non-empty value. request = index_endpoint_service.DeleteIndexEndpointRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2073,7 +2073,7 @@ async def test_delete_index_endpoint_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2256,7 +2256,7 @@ def test_deploy_index_field_headers(): # a field header. Set these to a non-empty value. request = index_endpoint_service.DeployIndexRequest() - request.index_endpoint = "index_endpoint/value" + request.index_endpoint = "index_endpoint_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.deploy_index), "__call__") as call: @@ -2272,7 +2272,7 @@ def test_deploy_index_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "index_endpoint=index_endpoint/value", + "index_endpoint=index_endpoint_value", ) in kw["metadata"] @@ -2286,7 +2286,7 @@ async def test_deploy_index_field_headers_async(): # a field header. Set these to a non-empty value. request = index_endpoint_service.DeployIndexRequest() - request.index_endpoint = "index_endpoint/value" + request.index_endpoint = "index_endpoint_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.deploy_index), "__call__") as call: @@ -2304,7 +2304,7 @@ async def test_deploy_index_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "index_endpoint=index_endpoint/value", + "index_endpoint=index_endpoint_value", ) in kw["metadata"] @@ -2493,7 +2493,7 @@ def test_undeploy_index_field_headers(): # a field header. Set these to a non-empty value. request = index_endpoint_service.UndeployIndexRequest() - request.index_endpoint = "index_endpoint/value" + request.index_endpoint = "index_endpoint_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.undeploy_index), "__call__") as call: @@ -2509,7 +2509,7 @@ def test_undeploy_index_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "index_endpoint=index_endpoint/value", + "index_endpoint=index_endpoint_value", ) in kw["metadata"] @@ -2523,7 +2523,7 @@ async def test_undeploy_index_field_headers_async(): # a field header. Set these to a non-empty value. request = index_endpoint_service.UndeployIndexRequest() - request.index_endpoint = "index_endpoint/value" + request.index_endpoint = "index_endpoint_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.undeploy_index), "__call__") as call: @@ -2541,7 +2541,7 @@ async def test_undeploy_index_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "index_endpoint=index_endpoint/value", + "index_endpoint=index_endpoint_value", ) in kw["metadata"] @@ -2736,7 +2736,7 @@ def test_mutate_deployed_index_field_headers(): # a field header. Set these to a non-empty value. request = index_endpoint_service.MutateDeployedIndexRequest() - request.index_endpoint = "index_endpoint/value" + request.index_endpoint = "index_endpoint_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2754,7 +2754,7 @@ def test_mutate_deployed_index_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "index_endpoint=index_endpoint/value", + "index_endpoint=index_endpoint_value", ) in kw["metadata"] @@ -2768,7 +2768,7 @@ async def test_mutate_deployed_index_field_headers_async(): # a field header. Set these to a non-empty value. request = index_endpoint_service.MutateDeployedIndexRequest() - request.index_endpoint = "index_endpoint/value" + request.index_endpoint = "index_endpoint_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2788,7 +2788,7 @@ async def test_mutate_deployed_index_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "index_endpoint=index_endpoint/value", + "index_endpoint=index_endpoint_value", ) in kw["metadata"] diff --git a/tests/unit/gapic/aiplatform_v1/test_index_service.py b/tests/unit/gapic/aiplatform_v1/test_index_service.py index bae06be190..f26c29e405 100644 --- a/tests/unit/gapic/aiplatform_v1/test_index_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_index_service.py @@ -736,7 +736,7 @@ def test_create_index_field_headers(): # a field header. Set these to a non-empty value. request = index_service.CreateIndexRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_index), "__call__") as call: @@ -752,7 +752,7 @@ def test_create_index_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -766,7 +766,7 @@ async def test_create_index_field_headers_async(): # a field header. Set these to a non-empty value. request = index_service.CreateIndexRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_index), "__call__") as call: @@ -784,7 +784,7 @@ async def test_create_index_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -994,7 +994,7 @@ def test_get_index_field_headers(): # a field header. Set these to a non-empty value. request = index_service.GetIndexRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_index), "__call__") as call: @@ -1010,7 +1010,7 @@ def test_get_index_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1024,7 +1024,7 @@ async def test_get_index_field_headers_async(): # a field header. Set these to a non-empty value. request = index_service.GetIndexRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_index), "__call__") as call: @@ -1040,7 +1040,7 @@ async def test_get_index_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1222,7 +1222,7 @@ def test_list_indexes_field_headers(): # a field header. Set these to a non-empty value. request = index_service.ListIndexesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_indexes), "__call__") as call: @@ -1238,7 +1238,7 @@ def test_list_indexes_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1252,7 +1252,7 @@ async def test_list_indexes_field_headers_async(): # a field header. Set these to a non-empty value. request = index_service.ListIndexesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_indexes), "__call__") as call: @@ -1270,7 +1270,7 @@ async def test_list_indexes_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1401,7 +1401,7 @@ def test_list_indexes_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, index.Index) for i in results) @@ -1636,7 +1636,7 @@ def test_update_index_field_headers(): # a field header. Set these to a non-empty value. request = index_service.UpdateIndexRequest() - request.index.name = "index.name/value" + request.index.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_index), "__call__") as call: @@ -1652,7 +1652,7 @@ def test_update_index_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "index.name=index.name/value", + "index.name=name_value", ) in kw["metadata"] @@ -1666,7 +1666,7 @@ async def test_update_index_field_headers_async(): # a field header. Set these to a non-empty value. request = index_service.UpdateIndexRequest() - request.index.name = "index.name/value" + request.index.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_index), "__call__") as call: @@ -1684,7 +1684,7 @@ async def test_update_index_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "index.name=index.name/value", + "index.name=name_value", ) in kw["metadata"] @@ -1872,7 +1872,7 @@ def test_delete_index_field_headers(): # a field header. Set these to a non-empty value. request = index_service.DeleteIndexRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_index), "__call__") as call: @@ -1888,7 +1888,7 @@ def test_delete_index_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1902,7 +1902,7 @@ async def test_delete_index_field_headers_async(): # a field header. Set these to a non-empty value. request = index_service.DeleteIndexRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_index), "__call__") as call: @@ -1920,7 +1920,7 @@ async def test_delete_index_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] diff --git a/tests/unit/gapic/aiplatform_v1/test_job_service.py b/tests/unit/gapic/aiplatform_v1/test_job_service.py index fee4114d25..c02439e56a 100644 --- a/tests/unit/gapic/aiplatform_v1/test_job_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_job_service.py @@ -777,7 +777,7 @@ def test_create_custom_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.CreateCustomJobRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -795,7 +795,7 @@ def test_create_custom_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -809,7 +809,7 @@ async def test_create_custom_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.CreateCustomJobRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -829,7 +829,7 @@ async def test_create_custom_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1035,7 +1035,7 @@ def test_get_custom_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.GetCustomJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_custom_job), "__call__") as call: @@ -1051,7 +1051,7 @@ def test_get_custom_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1065,7 +1065,7 @@ async def test_get_custom_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.GetCustomJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_custom_job), "__call__") as call: @@ -1083,7 +1083,7 @@ async def test_get_custom_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1267,7 +1267,7 @@ def test_list_custom_jobs_field_headers(): # a field header. Set these to a non-empty value. request = job_service.ListCustomJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_custom_jobs), "__call__") as call: @@ -1283,7 +1283,7 @@ def test_list_custom_jobs_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1297,7 +1297,7 @@ async def test_list_custom_jobs_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.ListCustomJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_custom_jobs), "__call__") as call: @@ -1315,7 +1315,7 @@ async def test_list_custom_jobs_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1446,7 +1446,7 @@ def test_list_custom_jobs_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, custom_job.CustomJob) for i in results) @@ -1687,7 +1687,7 @@ def test_delete_custom_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.DeleteCustomJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1705,7 +1705,7 @@ def test_delete_custom_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1719,7 +1719,7 @@ async def test_delete_custom_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.DeleteCustomJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1739,7 +1739,7 @@ async def test_delete_custom_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1925,7 +1925,7 @@ def test_cancel_custom_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.CancelCustomJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1943,7 +1943,7 @@ def test_cancel_custom_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1957,7 +1957,7 @@ async def test_cancel_custom_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.CancelCustomJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1975,7 +1975,7 @@ async def test_cancel_custom_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2200,7 +2200,7 @@ def test_create_data_labeling_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.CreateDataLabelingJobRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2218,7 +2218,7 @@ def test_create_data_labeling_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2232,7 +2232,7 @@ async def test_create_data_labeling_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.CreateDataLabelingJobRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2252,7 +2252,7 @@ async def test_create_data_labeling_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2488,7 +2488,7 @@ def test_get_data_labeling_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.GetDataLabelingJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2506,7 +2506,7 @@ def test_get_data_labeling_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2520,7 +2520,7 @@ async def test_get_data_labeling_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.GetDataLabelingJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2540,7 +2540,7 @@ async def test_get_data_labeling_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2735,7 +2735,7 @@ def test_list_data_labeling_jobs_field_headers(): # a field header. Set these to a non-empty value. request = job_service.ListDataLabelingJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2753,7 +2753,7 @@ def test_list_data_labeling_jobs_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2767,7 +2767,7 @@ async def test_list_data_labeling_jobs_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.ListDataLabelingJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2787,7 +2787,7 @@ async def test_list_data_labeling_jobs_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2924,7 +2924,7 @@ def test_list_data_labeling_jobs_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, data_labeling_job.DataLabelingJob) for i in results) @@ -3172,7 +3172,7 @@ def test_delete_data_labeling_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.DeleteDataLabelingJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3190,7 +3190,7 @@ def test_delete_data_labeling_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3204,7 +3204,7 @@ async def test_delete_data_labeling_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.DeleteDataLabelingJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3224,7 +3224,7 @@ async def test_delete_data_labeling_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3411,7 +3411,7 @@ def test_cancel_data_labeling_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.CancelDataLabelingJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3429,7 +3429,7 @@ def test_cancel_data_labeling_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3443,7 +3443,7 @@ async def test_cancel_data_labeling_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.CancelDataLabelingJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3461,7 +3461,7 @@ async def test_cancel_data_labeling_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3674,7 +3674,7 @@ def test_create_hyperparameter_tuning_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.CreateHyperparameterTuningJobRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3692,7 +3692,7 @@ def test_create_hyperparameter_tuning_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3706,7 +3706,7 @@ async def test_create_hyperparameter_tuning_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.CreateHyperparameterTuningJobRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3726,7 +3726,7 @@ async def test_create_hyperparameter_tuning_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3963,7 +3963,7 @@ def test_get_hyperparameter_tuning_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.GetHyperparameterTuningJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3981,7 +3981,7 @@ def test_get_hyperparameter_tuning_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3995,7 +3995,7 @@ async def test_get_hyperparameter_tuning_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.GetHyperparameterTuningJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4015,7 +4015,7 @@ async def test_get_hyperparameter_tuning_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4210,7 +4210,7 @@ def test_list_hyperparameter_tuning_jobs_field_headers(): # a field header. Set these to a non-empty value. request = job_service.ListHyperparameterTuningJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4228,7 +4228,7 @@ def test_list_hyperparameter_tuning_jobs_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4242,7 +4242,7 @@ async def test_list_hyperparameter_tuning_jobs_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.ListHyperparameterTuningJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4262,7 +4262,7 @@ async def test_list_hyperparameter_tuning_jobs_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4399,7 +4399,7 @@ def test_list_hyperparameter_tuning_jobs_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all( isinstance(i, hyperparameter_tuning_job.HyperparameterTuningJob) @@ -4653,7 +4653,7 @@ def test_delete_hyperparameter_tuning_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.DeleteHyperparameterTuningJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4671,7 +4671,7 @@ def test_delete_hyperparameter_tuning_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4685,7 +4685,7 @@ async def test_delete_hyperparameter_tuning_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.DeleteHyperparameterTuningJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4705,7 +4705,7 @@ async def test_delete_hyperparameter_tuning_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4892,7 +4892,7 @@ def test_cancel_hyperparameter_tuning_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.CancelHyperparameterTuningJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4910,7 +4910,7 @@ def test_cancel_hyperparameter_tuning_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4924,7 +4924,7 @@ async def test_cancel_hyperparameter_tuning_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.CancelHyperparameterTuningJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4942,7 +4942,7 @@ async def test_cancel_hyperparameter_tuning_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5151,7 +5151,7 @@ def test_create_batch_prediction_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.CreateBatchPredictionJobRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5169,7 +5169,7 @@ def test_create_batch_prediction_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5183,7 +5183,7 @@ async def test_create_batch_prediction_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.CreateBatchPredictionJobRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5203,7 +5203,7 @@ async def test_create_batch_prediction_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5432,7 +5432,7 @@ def test_get_batch_prediction_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.GetBatchPredictionJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5450,7 +5450,7 @@ def test_get_batch_prediction_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5464,7 +5464,7 @@ async def test_get_batch_prediction_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.GetBatchPredictionJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5484,7 +5484,7 @@ async def test_get_batch_prediction_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5679,7 +5679,7 @@ def test_list_batch_prediction_jobs_field_headers(): # a field header. Set these to a non-empty value. request = job_service.ListBatchPredictionJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5697,7 +5697,7 @@ def test_list_batch_prediction_jobs_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5711,7 +5711,7 @@ async def test_list_batch_prediction_jobs_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.ListBatchPredictionJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5731,7 +5731,7 @@ async def test_list_batch_prediction_jobs_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5868,7 +5868,7 @@ def test_list_batch_prediction_jobs_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all( isinstance(i, batch_prediction_job.BatchPredictionJob) for i in results @@ -6120,7 +6120,7 @@ def test_delete_batch_prediction_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.DeleteBatchPredictionJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6138,7 +6138,7 @@ def test_delete_batch_prediction_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -6152,7 +6152,7 @@ async def test_delete_batch_prediction_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.DeleteBatchPredictionJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6172,7 +6172,7 @@ async def test_delete_batch_prediction_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -6359,7 +6359,7 @@ def test_cancel_batch_prediction_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.CancelBatchPredictionJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6377,7 +6377,7 @@ def test_cancel_batch_prediction_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -6391,7 +6391,7 @@ async def test_cancel_batch_prediction_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.CancelBatchPredictionJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6409,7 +6409,7 @@ async def test_cancel_batch_prediction_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -6640,7 +6640,7 @@ def test_create_model_deployment_monitoring_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.CreateModelDeploymentMonitoringJobRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6660,7 +6660,7 @@ def test_create_model_deployment_monitoring_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -6674,7 +6674,7 @@ async def test_create_model_deployment_monitoring_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.CreateModelDeploymentMonitoringJobRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6694,7 +6694,7 @@ async def test_create_model_deployment_monitoring_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -6939,7 +6939,7 @@ def test_search_model_deployment_monitoring_stats_anomalies_field_headers(): # a field header. Set these to a non-empty value. request = job_service.SearchModelDeploymentMonitoringStatsAnomaliesRequest() - request.model_deployment_monitoring_job = "model_deployment_monitoring_job/value" + request.model_deployment_monitoring_job = "model_deployment_monitoring_job_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6960,7 +6960,7 @@ def test_search_model_deployment_monitoring_stats_anomalies_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "model_deployment_monitoring_job=model_deployment_monitoring_job/value", + "model_deployment_monitoring_job=model_deployment_monitoring_job_value", ) in kw["metadata"] @@ -6974,7 +6974,7 @@ async def test_search_model_deployment_monitoring_stats_anomalies_field_headers_ # a field header. Set these to a non-empty value. request = job_service.SearchModelDeploymentMonitoringStatsAnomaliesRequest() - request.model_deployment_monitoring_job = "model_deployment_monitoring_job/value" + request.model_deployment_monitoring_job = "model_deployment_monitoring_job_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6995,7 +6995,7 @@ async def test_search_model_deployment_monitoring_stats_anomalies_field_headers_ _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "model_deployment_monitoring_job=model_deployment_monitoring_job/value", + "model_deployment_monitoring_job=model_deployment_monitoring_job_value", ) in kw["metadata"] @@ -7153,7 +7153,7 @@ def test_search_model_deployment_monitoring_stats_anomalies_pager( assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all( isinstance( @@ -7460,7 +7460,7 @@ def test_get_model_deployment_monitoring_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.GetModelDeploymentMonitoringJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7480,7 +7480,7 @@ def test_get_model_deployment_monitoring_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -7494,7 +7494,7 @@ async def test_get_model_deployment_monitoring_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.GetModelDeploymentMonitoringJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7514,7 +7514,7 @@ async def test_get_model_deployment_monitoring_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -7713,7 +7713,7 @@ def test_list_model_deployment_monitoring_jobs_field_headers(): # a field header. Set these to a non-empty value. request = job_service.ListModelDeploymentMonitoringJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7731,7 +7731,7 @@ def test_list_model_deployment_monitoring_jobs_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -7745,7 +7745,7 @@ async def test_list_model_deployment_monitoring_jobs_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.ListModelDeploymentMonitoringJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7765,7 +7765,7 @@ async def test_list_model_deployment_monitoring_jobs_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -7902,7 +7902,7 @@ def test_list_model_deployment_monitoring_jobs_pager(transport_name: str = "grpc assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all( isinstance(i, model_deployment_monitoring_job.ModelDeploymentMonitoringJob) @@ -8156,9 +8156,7 @@ def test_update_model_deployment_monitoring_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.UpdateModelDeploymentMonitoringJobRequest() - request.model_deployment_monitoring_job.name = ( - "model_deployment_monitoring_job.name/value" - ) + request.model_deployment_monitoring_job.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8176,7 +8174,7 @@ def test_update_model_deployment_monitoring_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "model_deployment_monitoring_job.name=model_deployment_monitoring_job.name/value", + "model_deployment_monitoring_job.name=name_value", ) in kw["metadata"] @@ -8190,9 +8188,7 @@ async def test_update_model_deployment_monitoring_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.UpdateModelDeploymentMonitoringJobRequest() - request.model_deployment_monitoring_job.name = ( - "model_deployment_monitoring_job.name/value" - ) + request.model_deployment_monitoring_job.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8212,7 +8208,7 @@ async def test_update_model_deployment_monitoring_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "model_deployment_monitoring_job.name=model_deployment_monitoring_job.name/value", + "model_deployment_monitoring_job.name=name_value", ) in kw["metadata"] @@ -8423,7 +8419,7 @@ def test_delete_model_deployment_monitoring_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.DeleteModelDeploymentMonitoringJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8441,7 +8437,7 @@ def test_delete_model_deployment_monitoring_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -8455,7 +8451,7 @@ async def test_delete_model_deployment_monitoring_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.DeleteModelDeploymentMonitoringJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8475,7 +8471,7 @@ async def test_delete_model_deployment_monitoring_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -8662,7 +8658,7 @@ def test_pause_model_deployment_monitoring_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.PauseModelDeploymentMonitoringJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8680,7 +8676,7 @@ def test_pause_model_deployment_monitoring_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -8694,7 +8690,7 @@ async def test_pause_model_deployment_monitoring_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.PauseModelDeploymentMonitoringJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8712,7 +8708,7 @@ async def test_pause_model_deployment_monitoring_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -8897,7 +8893,7 @@ def test_resume_model_deployment_monitoring_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.ResumeModelDeploymentMonitoringJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8915,7 +8911,7 @@ def test_resume_model_deployment_monitoring_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -8929,7 +8925,7 @@ async def test_resume_model_deployment_monitoring_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.ResumeModelDeploymentMonitoringJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8947,7 +8943,7 @@ async def test_resume_model_deployment_monitoring_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] diff --git a/tests/unit/gapic/aiplatform_v1/test_metadata_service.py b/tests/unit/gapic/aiplatform_v1/test_metadata_service.py index 420e587fa6..150b4c8ab1 100644 --- a/tests/unit/gapic/aiplatform_v1/test_metadata_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_metadata_service.py @@ -782,7 +782,7 @@ def test_create_metadata_store_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.CreateMetadataStoreRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -800,7 +800,7 @@ def test_create_metadata_store_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -814,7 +814,7 @@ async def test_create_metadata_store_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.CreateMetadataStoreRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -834,7 +834,7 @@ async def test_create_metadata_store_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1053,7 +1053,7 @@ def test_get_metadata_store_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.GetMetadataStoreRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1071,7 +1071,7 @@ def test_get_metadata_store_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1085,7 +1085,7 @@ async def test_get_metadata_store_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.GetMetadataStoreRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1105,7 +1105,7 @@ async def test_get_metadata_store_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1300,7 +1300,7 @@ def test_list_metadata_stores_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.ListMetadataStoresRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1318,7 +1318,7 @@ def test_list_metadata_stores_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1332,7 +1332,7 @@ async def test_list_metadata_stores_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.ListMetadataStoresRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1352,7 +1352,7 @@ async def test_list_metadata_stores_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1489,7 +1489,7 @@ def test_list_metadata_stores_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, metadata_store.MetadataStore) for i in results) @@ -1737,7 +1737,7 @@ def test_delete_metadata_store_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.DeleteMetadataStoreRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1755,7 +1755,7 @@ def test_delete_metadata_store_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1769,7 +1769,7 @@ async def test_delete_metadata_store_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.DeleteMetadataStoreRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1789,7 +1789,7 @@ async def test_delete_metadata_store_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2005,7 +2005,7 @@ def test_create_artifact_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.CreateArtifactRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_artifact), "__call__") as call: @@ -2021,7 +2021,7 @@ def test_create_artifact_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2035,7 +2035,7 @@ async def test_create_artifact_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.CreateArtifactRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_artifact), "__call__") as call: @@ -2053,7 +2053,7 @@ async def test_create_artifact_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2285,7 +2285,7 @@ def test_get_artifact_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.GetArtifactRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_artifact), "__call__") as call: @@ -2301,7 +2301,7 @@ def test_get_artifact_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2315,7 +2315,7 @@ async def test_get_artifact_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.GetArtifactRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_artifact), "__call__") as call: @@ -2331,7 +2331,7 @@ async def test_get_artifact_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2513,7 +2513,7 @@ def test_list_artifacts_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.ListArtifactsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_artifacts), "__call__") as call: @@ -2529,7 +2529,7 @@ def test_list_artifacts_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2543,7 +2543,7 @@ async def test_list_artifacts_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.ListArtifactsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_artifacts), "__call__") as call: @@ -2561,7 +2561,7 @@ async def test_list_artifacts_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2692,7 +2692,7 @@ def test_list_artifacts_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, artifact.Artifact) for i in results) @@ -2961,7 +2961,7 @@ def test_update_artifact_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.UpdateArtifactRequest() - request.artifact.name = "artifact.name/value" + request.artifact.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_artifact), "__call__") as call: @@ -2977,7 +2977,7 @@ def test_update_artifact_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "artifact.name=artifact.name/value", + "artifact.name=name_value", ) in kw["metadata"] @@ -2991,7 +2991,7 @@ async def test_update_artifact_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.UpdateArtifactRequest() - request.artifact.name = "artifact.name/value" + request.artifact.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_artifact), "__call__") as call: @@ -3009,7 +3009,7 @@ async def test_update_artifact_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "artifact.name=artifact.name/value", + "artifact.name=name_value", ) in kw["metadata"] @@ -3197,7 +3197,7 @@ def test_delete_artifact_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.DeleteArtifactRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_artifact), "__call__") as call: @@ -3213,7 +3213,7 @@ def test_delete_artifact_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3227,7 +3227,7 @@ async def test_delete_artifact_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.DeleteArtifactRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_artifact), "__call__") as call: @@ -3245,7 +3245,7 @@ async def test_delete_artifact_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3423,7 +3423,7 @@ def test_purge_artifacts_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.PurgeArtifactsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.purge_artifacts), "__call__") as call: @@ -3439,7 +3439,7 @@ def test_purge_artifacts_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3453,7 +3453,7 @@ async def test_purge_artifacts_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.PurgeArtifactsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.purge_artifacts), "__call__") as call: @@ -3471,7 +3471,7 @@ async def test_purge_artifacts_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3679,7 +3679,7 @@ def test_create_context_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.CreateContextRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_context), "__call__") as call: @@ -3695,7 +3695,7 @@ def test_create_context_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3709,7 +3709,7 @@ async def test_create_context_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.CreateContextRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_context), "__call__") as call: @@ -3725,7 +3725,7 @@ async def test_create_context_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3951,7 +3951,7 @@ def test_get_context_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.GetContextRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_context), "__call__") as call: @@ -3967,7 +3967,7 @@ def test_get_context_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3981,7 +3981,7 @@ async def test_get_context_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.GetContextRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_context), "__call__") as call: @@ -3997,7 +3997,7 @@ async def test_get_context_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4179,7 +4179,7 @@ def test_list_contexts_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.ListContextsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_contexts), "__call__") as call: @@ -4195,7 +4195,7 @@ def test_list_contexts_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4209,7 +4209,7 @@ async def test_list_contexts_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.ListContextsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_contexts), "__call__") as call: @@ -4227,7 +4227,7 @@ async def test_list_contexts_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4358,7 +4358,7 @@ def test_list_contexts_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, context.Context) for i in results) @@ -4623,7 +4623,7 @@ def test_update_context_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.UpdateContextRequest() - request.context.name = "context.name/value" + request.context.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_context), "__call__") as call: @@ -4639,7 +4639,7 @@ def test_update_context_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "context.name=context.name/value", + "context.name=name_value", ) in kw["metadata"] @@ -4653,7 +4653,7 @@ async def test_update_context_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.UpdateContextRequest() - request.context.name = "context.name/value" + request.context.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_context), "__call__") as call: @@ -4669,7 +4669,7 @@ async def test_update_context_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "context.name=context.name/value", + "context.name=name_value", ) in kw["metadata"] @@ -4855,7 +4855,7 @@ def test_delete_context_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.DeleteContextRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_context), "__call__") as call: @@ -4871,7 +4871,7 @@ def test_delete_context_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4885,7 +4885,7 @@ async def test_delete_context_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.DeleteContextRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_context), "__call__") as call: @@ -4903,7 +4903,7 @@ async def test_delete_context_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5081,7 +5081,7 @@ def test_purge_contexts_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.PurgeContextsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.purge_contexts), "__call__") as call: @@ -5097,7 +5097,7 @@ def test_purge_contexts_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5111,7 +5111,7 @@ async def test_purge_contexts_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.PurgeContextsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.purge_contexts), "__call__") as call: @@ -5129,7 +5129,7 @@ async def test_purge_contexts_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5318,7 +5318,7 @@ def test_add_context_artifacts_and_executions_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.AddContextArtifactsAndExecutionsRequest() - request.context = "context/value" + request.context = "context_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5336,7 +5336,7 @@ def test_add_context_artifacts_and_executions_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "context=context/value", + "context=context_value", ) in kw["metadata"] @@ -5350,7 +5350,7 @@ async def test_add_context_artifacts_and_executions_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.AddContextArtifactsAndExecutionsRequest() - request.context = "context/value" + request.context = "context_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5370,7 +5370,7 @@ async def test_add_context_artifacts_and_executions_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "context=context/value", + "context=context_value", ) in kw["metadata"] @@ -5579,7 +5579,7 @@ def test_add_context_children_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.AddContextChildrenRequest() - request.context = "context/value" + request.context = "context_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5597,7 +5597,7 @@ def test_add_context_children_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "context=context/value", + "context=context_value", ) in kw["metadata"] @@ -5611,7 +5611,7 @@ async def test_add_context_children_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.AddContextChildrenRequest() - request.context = "context/value" + request.context = "context_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5631,7 +5631,7 @@ async def test_add_context_children_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "context=context/value", + "context=context_value", ) in kw["metadata"] @@ -5830,7 +5830,7 @@ def test_query_context_lineage_subgraph_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.QueryContextLineageSubgraphRequest() - request.context = "context/value" + request.context = "context_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5848,7 +5848,7 @@ def test_query_context_lineage_subgraph_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "context=context/value", + "context=context_value", ) in kw["metadata"] @@ -5862,7 +5862,7 @@ async def test_query_context_lineage_subgraph_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.QueryContextLineageSubgraphRequest() - request.context = "context/value" + request.context = "context_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5882,7 +5882,7 @@ async def test_query_context_lineage_subgraph_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "context=context/value", + "context=context_value", ) in kw["metadata"] @@ -6095,7 +6095,7 @@ def test_create_execution_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.CreateExecutionRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_execution), "__call__") as call: @@ -6111,7 +6111,7 @@ def test_create_execution_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -6125,7 +6125,7 @@ async def test_create_execution_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.CreateExecutionRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_execution), "__call__") as call: @@ -6143,7 +6143,7 @@ async def test_create_execution_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -6371,7 +6371,7 @@ def test_get_execution_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.GetExecutionRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_execution), "__call__") as call: @@ -6387,7 +6387,7 @@ def test_get_execution_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -6401,7 +6401,7 @@ async def test_get_execution_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.GetExecutionRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_execution), "__call__") as call: @@ -6417,7 +6417,7 @@ async def test_get_execution_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -6599,7 +6599,7 @@ def test_list_executions_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.ListExecutionsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_executions), "__call__") as call: @@ -6615,7 +6615,7 @@ def test_list_executions_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -6629,7 +6629,7 @@ async def test_list_executions_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.ListExecutionsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_executions), "__call__") as call: @@ -6647,7 +6647,7 @@ async def test_list_executions_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -6778,7 +6778,7 @@ def test_list_executions_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, execution.Execution) for i in results) @@ -7044,7 +7044,7 @@ def test_update_execution_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.UpdateExecutionRequest() - request.execution.name = "execution.name/value" + request.execution.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_execution), "__call__") as call: @@ -7060,7 +7060,7 @@ def test_update_execution_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "execution.name=execution.name/value", + "execution.name=name_value", ) in kw["metadata"] @@ -7074,7 +7074,7 @@ async def test_update_execution_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.UpdateExecutionRequest() - request.execution.name = "execution.name/value" + request.execution.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_execution), "__call__") as call: @@ -7092,7 +7092,7 @@ async def test_update_execution_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "execution.name=execution.name/value", + "execution.name=name_value", ) in kw["metadata"] @@ -7281,7 +7281,7 @@ def test_delete_execution_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.DeleteExecutionRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_execution), "__call__") as call: @@ -7297,7 +7297,7 @@ def test_delete_execution_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -7311,7 +7311,7 @@ async def test_delete_execution_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.DeleteExecutionRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_execution), "__call__") as call: @@ -7329,7 +7329,7 @@ async def test_delete_execution_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -7508,7 +7508,7 @@ def test_purge_executions_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.PurgeExecutionsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.purge_executions), "__call__") as call: @@ -7524,7 +7524,7 @@ def test_purge_executions_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -7538,7 +7538,7 @@ async def test_purge_executions_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.PurgeExecutionsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.purge_executions), "__call__") as call: @@ -7556,7 +7556,7 @@ async def test_purge_executions_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -7741,7 +7741,7 @@ def test_add_execution_events_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.AddExecutionEventsRequest() - request.execution = "execution/value" + request.execution = "execution_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7759,7 +7759,7 @@ def test_add_execution_events_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "execution=execution/value", + "execution=execution_value", ) in kw["metadata"] @@ -7773,7 +7773,7 @@ async def test_add_execution_events_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.AddExecutionEventsRequest() - request.execution = "execution/value" + request.execution = "execution_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7793,7 +7793,7 @@ async def test_add_execution_events_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "execution=execution/value", + "execution=execution_value", ) in kw["metadata"] @@ -7992,7 +7992,7 @@ def test_query_execution_inputs_and_outputs_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.QueryExecutionInputsAndOutputsRequest() - request.execution = "execution/value" + request.execution = "execution_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8010,7 +8010,7 @@ def test_query_execution_inputs_and_outputs_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "execution=execution/value", + "execution=execution_value", ) in kw["metadata"] @@ -8024,7 +8024,7 @@ async def test_query_execution_inputs_and_outputs_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.QueryExecutionInputsAndOutputsRequest() - request.execution = "execution/value" + request.execution = "execution_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8044,7 +8044,7 @@ async def test_query_execution_inputs_and_outputs_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "execution=execution/value", + "execution=execution_value", ) in kw["metadata"] @@ -8261,7 +8261,7 @@ def test_create_metadata_schema_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.CreateMetadataSchemaRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8279,7 +8279,7 @@ def test_create_metadata_schema_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -8293,7 +8293,7 @@ async def test_create_metadata_schema_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.CreateMetadataSchemaRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8313,7 +8313,7 @@ async def test_create_metadata_schema_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -8550,7 +8550,7 @@ def test_get_metadata_schema_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.GetMetadataSchemaRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8568,7 +8568,7 @@ def test_get_metadata_schema_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -8582,7 +8582,7 @@ async def test_get_metadata_schema_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.GetMetadataSchemaRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8602,7 +8602,7 @@ async def test_get_metadata_schema_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -8797,7 +8797,7 @@ def test_list_metadata_schemas_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.ListMetadataSchemasRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8815,7 +8815,7 @@ def test_list_metadata_schemas_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -8829,7 +8829,7 @@ async def test_list_metadata_schemas_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.ListMetadataSchemasRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8849,7 +8849,7 @@ async def test_list_metadata_schemas_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -8986,7 +8986,7 @@ def test_list_metadata_schemas_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, metadata_schema.MetadataSchema) for i in results) @@ -9234,7 +9234,7 @@ def test_query_artifact_lineage_subgraph_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.QueryArtifactLineageSubgraphRequest() - request.artifact = "artifact/value" + request.artifact = "artifact_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -9252,7 +9252,7 @@ def test_query_artifact_lineage_subgraph_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "artifact=artifact/value", + "artifact=artifact_value", ) in kw["metadata"] @@ -9266,7 +9266,7 @@ async def test_query_artifact_lineage_subgraph_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.QueryArtifactLineageSubgraphRequest() - request.artifact = "artifact/value" + request.artifact = "artifact_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -9286,7 +9286,7 @@ async def test_query_artifact_lineage_subgraph_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "artifact=artifact/value", + "artifact=artifact_value", ) in kw["metadata"] diff --git a/tests/unit/gapic/aiplatform_v1/test_migration_service.py b/tests/unit/gapic/aiplatform_v1/test_migration_service.py index 25b945c669..2d38e9a189 100644 --- a/tests/unit/gapic/aiplatform_v1/test_migration_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_migration_service.py @@ -773,7 +773,7 @@ def test_search_migratable_resources_field_headers(): # a field header. Set these to a non-empty value. request = migration_service.SearchMigratableResourcesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -791,7 +791,7 @@ def test_search_migratable_resources_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -805,7 +805,7 @@ async def test_search_migratable_resources_field_headers_async(): # a field header. Set these to a non-empty value. request = migration_service.SearchMigratableResourcesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -825,7 +825,7 @@ async def test_search_migratable_resources_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -962,7 +962,7 @@ def test_search_migratable_resources_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all( isinstance(i, migratable_resource.MigratableResource) for i in results @@ -1214,7 +1214,7 @@ def test_batch_migrate_resources_field_headers(): # a field header. Set these to a non-empty value. request = migration_service.BatchMigrateResourcesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1232,7 +1232,7 @@ def test_batch_migrate_resources_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1246,7 +1246,7 @@ async def test_batch_migrate_resources_field_headers_async(): # a field header. Set these to a non-empty value. request = migration_service.BatchMigrateResourcesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1266,7 +1266,7 @@ async def test_batch_migrate_resources_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1933,22 +1933,19 @@ def test_parse_annotated_dataset_path(): def test_dataset_path(): project = "cuttlefish" - location = "mussel" - dataset = "winkle" - expected = "projects/{project}/locations/{location}/datasets/{dataset}".format( + dataset = "mussel" + expected = "projects/{project}/datasets/{dataset}".format( project=project, - location=location, dataset=dataset, ) - actual = MigrationServiceClient.dataset_path(project, location, dataset) + actual = MigrationServiceClient.dataset_path(project, dataset) assert expected == actual def test_parse_dataset_path(): expected = { - "project": "nautilus", - "location": "scallop", - "dataset": "abalone", + "project": "winkle", + "dataset": "nautilus", } path = MigrationServiceClient.dataset_path(**expected) @@ -1958,9 +1955,9 @@ def test_parse_dataset_path(): def test_dataset_path(): - project = "squid" - location = "clam" - dataset = "whelk" + project = "scallop" + location = "abalone" + dataset = "squid" expected = "projects/{project}/locations/{location}/datasets/{dataset}".format( project=project, location=location, @@ -1972,9 +1969,9 @@ def test_dataset_path(): def test_parse_dataset_path(): expected = { - "project": "octopus", - "location": "oyster", - "dataset": "nudibranch", + "project": "clam", + "location": "whelk", + "dataset": "octopus", } path = MigrationServiceClient.dataset_path(**expected) @@ -1984,19 +1981,22 @@ def test_parse_dataset_path(): def test_dataset_path(): - project = "cuttlefish" - dataset = "mussel" - expected = "projects/{project}/datasets/{dataset}".format( + project = "oyster" + location = "nudibranch" + dataset = "cuttlefish" + expected = "projects/{project}/locations/{location}/datasets/{dataset}".format( project=project, + location=location, dataset=dataset, ) - actual = MigrationServiceClient.dataset_path(project, dataset) + actual = MigrationServiceClient.dataset_path(project, location, dataset) assert expected == actual def test_parse_dataset_path(): expected = { - "project": "winkle", + "project": "mussel", + "location": "winkle", "dataset": "nautilus", } path = MigrationServiceClient.dataset_path(**expected) diff --git a/tests/unit/gapic/aiplatform_v1/test_model_service.py b/tests/unit/gapic/aiplatform_v1/test_model_service.py index fec266b88f..a02df4c752 100644 --- a/tests/unit/gapic/aiplatform_v1/test_model_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_model_service.py @@ -744,7 +744,7 @@ def test_upload_model_field_headers(): # a field header. Set these to a non-empty value. request = model_service.UploadModelRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.upload_model), "__call__") as call: @@ -760,7 +760,7 @@ def test_upload_model_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -774,7 +774,7 @@ async def test_upload_model_field_headers_async(): # a field header. Set these to a non-empty value. request = model_service.UploadModelRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.upload_model), "__call__") as call: @@ -792,7 +792,7 @@ async def test_upload_model_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1042,7 +1042,7 @@ def test_get_model_field_headers(): # a field header. Set these to a non-empty value. request = model_service.GetModelRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_model), "__call__") as call: @@ -1058,7 +1058,7 @@ def test_get_model_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1072,7 +1072,7 @@ async def test_get_model_field_headers_async(): # a field header. Set these to a non-empty value. request = model_service.GetModelRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_model), "__call__") as call: @@ -1088,7 +1088,7 @@ async def test_get_model_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1270,7 +1270,7 @@ def test_list_models_field_headers(): # a field header. Set these to a non-empty value. request = model_service.ListModelsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_models), "__call__") as call: @@ -1286,7 +1286,7 @@ def test_list_models_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1300,7 +1300,7 @@ async def test_list_models_field_headers_async(): # a field header. Set these to a non-empty value. request = model_service.ListModelsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_models), "__call__") as call: @@ -1318,7 +1318,7 @@ async def test_list_models_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1449,7 +1449,7 @@ def test_list_models_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, model.Model) for i in results) @@ -1746,7 +1746,7 @@ def test_update_model_field_headers(): # a field header. Set these to a non-empty value. request = model_service.UpdateModelRequest() - request.model.name = "model.name/value" + request.model.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_model), "__call__") as call: @@ -1762,7 +1762,7 @@ def test_update_model_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "model.name=model.name/value", + "model.name=name_value", ) in kw["metadata"] @@ -1776,7 +1776,7 @@ async def test_update_model_field_headers_async(): # a field header. Set these to a non-empty value. request = model_service.UpdateModelRequest() - request.model.name = "model.name/value" + request.model.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_model), "__call__") as call: @@ -1792,7 +1792,7 @@ async def test_update_model_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "model.name=model.name/value", + "model.name=name_value", ) in kw["metadata"] @@ -1978,7 +1978,7 @@ def test_delete_model_field_headers(): # a field header. Set these to a non-empty value. request = model_service.DeleteModelRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_model), "__call__") as call: @@ -1994,7 +1994,7 @@ def test_delete_model_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2008,7 +2008,7 @@ async def test_delete_model_field_headers_async(): # a field header. Set these to a non-empty value. request = model_service.DeleteModelRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_model), "__call__") as call: @@ -2026,7 +2026,7 @@ async def test_delete_model_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2204,7 +2204,7 @@ def test_export_model_field_headers(): # a field header. Set these to a non-empty value. request = model_service.ExportModelRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.export_model), "__call__") as call: @@ -2220,7 +2220,7 @@ def test_export_model_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2234,7 +2234,7 @@ async def test_export_model_field_headers_async(): # a field header. Set these to a non-empty value. request = model_service.ExportModelRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.export_model), "__call__") as call: @@ -2252,7 +2252,7 @@ async def test_export_model_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2481,7 +2481,7 @@ def test_import_model_evaluation_field_headers(): # a field header. Set these to a non-empty value. request = model_service.ImportModelEvaluationRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2499,7 +2499,7 @@ def test_import_model_evaluation_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2513,7 +2513,7 @@ async def test_import_model_evaluation_field_headers_async(): # a field header. Set these to a non-empty value. request = model_service.ImportModelEvaluationRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2533,7 +2533,7 @@ async def test_import_model_evaluation_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2754,7 +2754,7 @@ def test_get_model_evaluation_field_headers(): # a field header. Set these to a non-empty value. request = model_service.GetModelEvaluationRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2772,7 +2772,7 @@ def test_get_model_evaluation_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2786,7 +2786,7 @@ async def test_get_model_evaluation_field_headers_async(): # a field header. Set these to a non-empty value. request = model_service.GetModelEvaluationRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2806,7 +2806,7 @@ async def test_get_model_evaluation_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3001,7 +3001,7 @@ def test_list_model_evaluations_field_headers(): # a field header. Set these to a non-empty value. request = model_service.ListModelEvaluationsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3019,7 +3019,7 @@ def test_list_model_evaluations_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3033,7 +3033,7 @@ async def test_list_model_evaluations_field_headers_async(): # a field header. Set these to a non-empty value. request = model_service.ListModelEvaluationsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3053,7 +3053,7 @@ async def test_list_model_evaluations_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3190,7 +3190,7 @@ def test_list_model_evaluations_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, model_evaluation.ModelEvaluation) for i in results) @@ -3448,7 +3448,7 @@ def test_get_model_evaluation_slice_field_headers(): # a field header. Set these to a non-empty value. request = model_service.GetModelEvaluationSliceRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3466,7 +3466,7 @@ def test_get_model_evaluation_slice_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3480,7 +3480,7 @@ async def test_get_model_evaluation_slice_field_headers_async(): # a field header. Set these to a non-empty value. request = model_service.GetModelEvaluationSliceRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3500,7 +3500,7 @@ async def test_get_model_evaluation_slice_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3695,7 +3695,7 @@ def test_list_model_evaluation_slices_field_headers(): # a field header. Set these to a non-empty value. request = model_service.ListModelEvaluationSlicesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3713,7 +3713,7 @@ def test_list_model_evaluation_slices_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3727,7 +3727,7 @@ async def test_list_model_evaluation_slices_field_headers_async(): # a field header. Set these to a non-empty value. request = model_service.ListModelEvaluationSlicesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3747,7 +3747,7 @@ async def test_list_model_evaluation_slices_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3884,7 +3884,7 @@ def test_list_model_evaluation_slices_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all( isinstance(i, model_evaluation_slice.ModelEvaluationSlice) for i in results diff --git a/tests/unit/gapic/aiplatform_v1/test_pipeline_service.py b/tests/unit/gapic/aiplatform_v1/test_pipeline_service.py index c1b9ce0dad..86a01f4d50 100644 --- a/tests/unit/gapic/aiplatform_v1/test_pipeline_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_pipeline_service.py @@ -805,7 +805,7 @@ def test_create_training_pipeline_field_headers(): # a field header. Set these to a non-empty value. request = pipeline_service.CreateTrainingPipelineRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -823,7 +823,7 @@ def test_create_training_pipeline_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -837,7 +837,7 @@ async def test_create_training_pipeline_field_headers_async(): # a field header. Set these to a non-empty value. request = pipeline_service.CreateTrainingPipelineRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -857,7 +857,7 @@ async def test_create_training_pipeline_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1074,7 +1074,7 @@ def test_get_training_pipeline_field_headers(): # a field header. Set these to a non-empty value. request = pipeline_service.GetTrainingPipelineRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1092,7 +1092,7 @@ def test_get_training_pipeline_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1106,7 +1106,7 @@ async def test_get_training_pipeline_field_headers_async(): # a field header. Set these to a non-empty value. request = pipeline_service.GetTrainingPipelineRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1126,7 +1126,7 @@ async def test_get_training_pipeline_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1321,7 +1321,7 @@ def test_list_training_pipelines_field_headers(): # a field header. Set these to a non-empty value. request = pipeline_service.ListTrainingPipelinesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1339,7 +1339,7 @@ def test_list_training_pipelines_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1353,7 +1353,7 @@ async def test_list_training_pipelines_field_headers_async(): # a field header. Set these to a non-empty value. request = pipeline_service.ListTrainingPipelinesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1373,7 +1373,7 @@ async def test_list_training_pipelines_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1510,7 +1510,7 @@ def test_list_training_pipelines_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, training_pipeline.TrainingPipeline) for i in results) @@ -1758,7 +1758,7 @@ def test_delete_training_pipeline_field_headers(): # a field header. Set these to a non-empty value. request = pipeline_service.DeleteTrainingPipelineRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1776,7 +1776,7 @@ def test_delete_training_pipeline_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1790,7 +1790,7 @@ async def test_delete_training_pipeline_field_headers_async(): # a field header. Set these to a non-empty value. request = pipeline_service.DeleteTrainingPipelineRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1810,7 +1810,7 @@ async def test_delete_training_pipeline_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1997,7 +1997,7 @@ def test_cancel_training_pipeline_field_headers(): # a field header. Set these to a non-empty value. request = pipeline_service.CancelTrainingPipelineRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2015,7 +2015,7 @@ def test_cancel_training_pipeline_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2029,7 +2029,7 @@ async def test_cancel_training_pipeline_field_headers_async(): # a field header. Set these to a non-empty value. request = pipeline_service.CancelTrainingPipelineRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2047,7 +2047,7 @@ async def test_cancel_training_pipeline_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2256,7 +2256,7 @@ def test_create_pipeline_job_field_headers(): # a field header. Set these to a non-empty value. request = pipeline_service.CreatePipelineJobRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2274,7 +2274,7 @@ def test_create_pipeline_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2288,7 +2288,7 @@ async def test_create_pipeline_job_field_headers_async(): # a field header. Set these to a non-empty value. request = pipeline_service.CreatePipelineJobRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2308,7 +2308,7 @@ async def test_create_pipeline_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2532,7 +2532,7 @@ def test_get_pipeline_job_field_headers(): # a field header. Set these to a non-empty value. request = pipeline_service.GetPipelineJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_pipeline_job), "__call__") as call: @@ -2548,7 +2548,7 @@ def test_get_pipeline_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2562,7 +2562,7 @@ async def test_get_pipeline_job_field_headers_async(): # a field header. Set these to a non-empty value. request = pipeline_service.GetPipelineJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_pipeline_job), "__call__") as call: @@ -2580,7 +2580,7 @@ async def test_get_pipeline_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2771,7 +2771,7 @@ def test_list_pipeline_jobs_field_headers(): # a field header. Set these to a non-empty value. request = pipeline_service.ListPipelineJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2789,7 +2789,7 @@ def test_list_pipeline_jobs_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2803,7 +2803,7 @@ async def test_list_pipeline_jobs_field_headers_async(): # a field header. Set these to a non-empty value. request = pipeline_service.ListPipelineJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2823,7 +2823,7 @@ async def test_list_pipeline_jobs_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2960,7 +2960,7 @@ def test_list_pipeline_jobs_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, pipeline_job.PipelineJob) for i in results) @@ -3208,7 +3208,7 @@ def test_delete_pipeline_job_field_headers(): # a field header. Set these to a non-empty value. request = pipeline_service.DeletePipelineJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3226,7 +3226,7 @@ def test_delete_pipeline_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3240,7 +3240,7 @@ async def test_delete_pipeline_job_field_headers_async(): # a field header. Set these to a non-empty value. request = pipeline_service.DeletePipelineJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3260,7 +3260,7 @@ async def test_delete_pipeline_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3447,7 +3447,7 @@ def test_cancel_pipeline_job_field_headers(): # a field header. Set these to a non-empty value. request = pipeline_service.CancelPipelineJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3465,7 +3465,7 @@ def test_cancel_pipeline_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3479,7 +3479,7 @@ async def test_cancel_pipeline_job_field_headers_async(): # a field header. Set these to a non-empty value. request = pipeline_service.CancelPipelineJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3497,7 +3497,7 @@ async def test_cancel_pipeline_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] diff --git a/tests/unit/gapic/aiplatform_v1/test_prediction_service.py b/tests/unit/gapic/aiplatform_v1/test_prediction_service.py index d7db36793c..2f1813de9f 100644 --- a/tests/unit/gapic/aiplatform_v1/test_prediction_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_prediction_service.py @@ -773,7 +773,7 @@ def test_predict_field_headers(): # a field header. Set these to a non-empty value. request = prediction_service.PredictRequest() - request.endpoint = "endpoint/value" + request.endpoint = "endpoint_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.predict), "__call__") as call: @@ -789,7 +789,7 @@ def test_predict_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "endpoint=endpoint/value", + "endpoint=endpoint_value", ) in kw["metadata"] @@ -803,7 +803,7 @@ async def test_predict_field_headers_async(): # a field header. Set these to a non-empty value. request = prediction_service.PredictRequest() - request.endpoint = "endpoint/value" + request.endpoint = "endpoint_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.predict), "__call__") as call: @@ -821,7 +821,7 @@ async def test_predict_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "endpoint=endpoint/value", + "endpoint=endpoint_value", ) in kw["metadata"] @@ -960,7 +960,7 @@ def test_raw_predict_field_headers(): # a field header. Set these to a non-empty value. request = prediction_service.RawPredictRequest() - request.endpoint = "endpoint/value" + request.endpoint = "endpoint_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.raw_predict), "__call__") as call: @@ -976,7 +976,7 @@ def test_raw_predict_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "endpoint=endpoint/value", + "endpoint=endpoint_value", ) in kw["metadata"] @@ -990,7 +990,7 @@ async def test_raw_predict_field_headers_async(): # a field header. Set these to a non-empty value. request = prediction_service.RawPredictRequest() - request.endpoint = "endpoint/value" + request.endpoint = "endpoint_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.raw_predict), "__call__") as call: @@ -1008,7 +1008,7 @@ async def test_raw_predict_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "endpoint=endpoint/value", + "endpoint=endpoint_value", ) in kw["metadata"] @@ -1202,7 +1202,7 @@ def test_explain_field_headers(): # a field header. Set these to a non-empty value. request = prediction_service.ExplainRequest() - request.endpoint = "endpoint/value" + request.endpoint = "endpoint_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.explain), "__call__") as call: @@ -1218,7 +1218,7 @@ def test_explain_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "endpoint=endpoint/value", + "endpoint=endpoint_value", ) in kw["metadata"] @@ -1232,7 +1232,7 @@ async def test_explain_field_headers_async(): # a field header. Set these to a non-empty value. request = prediction_service.ExplainRequest() - request.endpoint = "endpoint/value" + request.endpoint = "endpoint_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.explain), "__call__") as call: @@ -1250,7 +1250,7 @@ async def test_explain_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "endpoint=endpoint/value", + "endpoint=endpoint_value", ) in kw["metadata"] diff --git a/tests/unit/gapic/aiplatform_v1/test_specialist_pool_service.py b/tests/unit/gapic/aiplatform_v1/test_specialist_pool_service.py index 3bac3cac14..16ac1df1ea 100644 --- a/tests/unit/gapic/aiplatform_v1/test_specialist_pool_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_specialist_pool_service.py @@ -780,7 +780,7 @@ def test_create_specialist_pool_field_headers(): # a field header. Set these to a non-empty value. request = specialist_pool_service.CreateSpecialistPoolRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -798,7 +798,7 @@ def test_create_specialist_pool_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -812,7 +812,7 @@ async def test_create_specialist_pool_field_headers_async(): # a field header. Set these to a non-empty value. request = specialist_pool_service.CreateSpecialistPoolRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -832,7 +832,7 @@ async def test_create_specialist_pool_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1057,7 +1057,7 @@ def test_get_specialist_pool_field_headers(): # a field header. Set these to a non-empty value. request = specialist_pool_service.GetSpecialistPoolRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1075,7 +1075,7 @@ def test_get_specialist_pool_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1089,7 +1089,7 @@ async def test_get_specialist_pool_field_headers_async(): # a field header. Set these to a non-empty value. request = specialist_pool_service.GetSpecialistPoolRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1109,7 +1109,7 @@ async def test_get_specialist_pool_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1304,7 +1304,7 @@ def test_list_specialist_pools_field_headers(): # a field header. Set these to a non-empty value. request = specialist_pool_service.ListSpecialistPoolsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1322,7 +1322,7 @@ def test_list_specialist_pools_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1336,7 +1336,7 @@ async def test_list_specialist_pools_field_headers_async(): # a field header. Set these to a non-empty value. request = specialist_pool_service.ListSpecialistPoolsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1356,7 +1356,7 @@ async def test_list_specialist_pools_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1493,7 +1493,7 @@ def test_list_specialist_pools_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, specialist_pool.SpecialistPool) for i in results) @@ -1741,7 +1741,7 @@ def test_delete_specialist_pool_field_headers(): # a field header. Set these to a non-empty value. request = specialist_pool_service.DeleteSpecialistPoolRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1759,7 +1759,7 @@ def test_delete_specialist_pool_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1773,7 +1773,7 @@ async def test_delete_specialist_pool_field_headers_async(): # a field header. Set these to a non-empty value. request = specialist_pool_service.DeleteSpecialistPoolRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1793,7 +1793,7 @@ async def test_delete_specialist_pool_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1982,7 +1982,7 @@ def test_update_specialist_pool_field_headers(): # a field header. Set these to a non-empty value. request = specialist_pool_service.UpdateSpecialistPoolRequest() - request.specialist_pool.name = "specialist_pool.name/value" + request.specialist_pool.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2000,7 +2000,7 @@ def test_update_specialist_pool_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "specialist_pool.name=specialist_pool.name/value", + "specialist_pool.name=name_value", ) in kw["metadata"] @@ -2014,7 +2014,7 @@ async def test_update_specialist_pool_field_headers_async(): # a field header. Set these to a non-empty value. request = specialist_pool_service.UpdateSpecialistPoolRequest() - request.specialist_pool.name = "specialist_pool.name/value" + request.specialist_pool.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2034,7 +2034,7 @@ async def test_update_specialist_pool_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "specialist_pool.name=specialist_pool.name/value", + "specialist_pool.name=name_value", ) in kw["metadata"] diff --git a/tests/unit/gapic/aiplatform_v1/test_tensorboard_service.py b/tests/unit/gapic/aiplatform_v1/test_tensorboard_service.py index 9b9c00c7b7..5eb0930a18 100644 --- a/tests/unit/gapic/aiplatform_v1/test_tensorboard_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_tensorboard_service.py @@ -788,7 +788,7 @@ def test_create_tensorboard_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.CreateTensorboardRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -806,7 +806,7 @@ def test_create_tensorboard_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -820,7 +820,7 @@ async def test_create_tensorboard_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.CreateTensorboardRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -840,7 +840,7 @@ async def test_create_tensorboard_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1059,7 +1059,7 @@ def test_get_tensorboard_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.GetTensorboardRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_tensorboard), "__call__") as call: @@ -1075,7 +1075,7 @@ def test_get_tensorboard_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1089,7 +1089,7 @@ async def test_get_tensorboard_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.GetTensorboardRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_tensorboard), "__call__") as call: @@ -1107,7 +1107,7 @@ async def test_get_tensorboard_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1292,7 +1292,7 @@ def test_update_tensorboard_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.UpdateTensorboardRequest() - request.tensorboard.name = "tensorboard.name/value" + request.tensorboard.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1310,7 +1310,7 @@ def test_update_tensorboard_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tensorboard.name=tensorboard.name/value", + "tensorboard.name=name_value", ) in kw["metadata"] @@ -1324,7 +1324,7 @@ async def test_update_tensorboard_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.UpdateTensorboardRequest() - request.tensorboard.name = "tensorboard.name/value" + request.tensorboard.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1344,7 +1344,7 @@ async def test_update_tensorboard_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tensorboard.name=tensorboard.name/value", + "tensorboard.name=name_value", ) in kw["metadata"] @@ -1549,7 +1549,7 @@ def test_list_tensorboards_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.ListTensorboardsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1567,7 +1567,7 @@ def test_list_tensorboards_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1581,7 +1581,7 @@ async def test_list_tensorboards_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.ListTensorboardsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1601,7 +1601,7 @@ async def test_list_tensorboards_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1738,7 +1738,7 @@ def test_list_tensorboards_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, tensorboard.Tensorboard) for i in results) @@ -1986,7 +1986,7 @@ def test_delete_tensorboard_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.DeleteTensorboardRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2004,7 +2004,7 @@ def test_delete_tensorboard_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2018,7 +2018,7 @@ async def test_delete_tensorboard_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.DeleteTensorboardRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2038,7 +2038,7 @@ async def test_delete_tensorboard_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2249,7 +2249,7 @@ def test_create_tensorboard_experiment_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.CreateTensorboardExperimentRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2267,7 +2267,7 @@ def test_create_tensorboard_experiment_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2281,7 +2281,7 @@ async def test_create_tensorboard_experiment_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.CreateTensorboardExperimentRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2301,7 +2301,7 @@ async def test_create_tensorboard_experiment_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2540,7 +2540,7 @@ def test_get_tensorboard_experiment_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.GetTensorboardExperimentRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2558,7 +2558,7 @@ def test_get_tensorboard_experiment_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2572,7 +2572,7 @@ async def test_get_tensorboard_experiment_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.GetTensorboardExperimentRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2592,7 +2592,7 @@ async def test_get_tensorboard_experiment_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2803,7 +2803,7 @@ def test_update_tensorboard_experiment_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.UpdateTensorboardExperimentRequest() - request.tensorboard_experiment.name = "tensorboard_experiment.name/value" + request.tensorboard_experiment.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2821,7 +2821,7 @@ def test_update_tensorboard_experiment_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tensorboard_experiment.name=tensorboard_experiment.name/value", + "tensorboard_experiment.name=name_value", ) in kw["metadata"] @@ -2835,7 +2835,7 @@ async def test_update_tensorboard_experiment_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.UpdateTensorboardExperimentRequest() - request.tensorboard_experiment.name = "tensorboard_experiment.name/value" + request.tensorboard_experiment.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2855,7 +2855,7 @@ async def test_update_tensorboard_experiment_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tensorboard_experiment.name=tensorboard_experiment.name/value", + "tensorboard_experiment.name=name_value", ) in kw["metadata"] @@ -3068,7 +3068,7 @@ def test_list_tensorboard_experiments_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.ListTensorboardExperimentsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3086,7 +3086,7 @@ def test_list_tensorboard_experiments_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3100,7 +3100,7 @@ async def test_list_tensorboard_experiments_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.ListTensorboardExperimentsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3120,7 +3120,7 @@ async def test_list_tensorboard_experiments_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3257,7 +3257,7 @@ def test_list_tensorboard_experiments_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all( isinstance(i, tensorboard_experiment.TensorboardExperiment) for i in results @@ -3510,7 +3510,7 @@ def test_delete_tensorboard_experiment_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.DeleteTensorboardExperimentRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3528,7 +3528,7 @@ def test_delete_tensorboard_experiment_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3542,7 +3542,7 @@ async def test_delete_tensorboard_experiment_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.DeleteTensorboardExperimentRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3562,7 +3562,7 @@ async def test_delete_tensorboard_experiment_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3769,7 +3769,7 @@ def test_create_tensorboard_run_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.CreateTensorboardRunRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3787,7 +3787,7 @@ def test_create_tensorboard_run_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3801,7 +3801,7 @@ async def test_create_tensorboard_run_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.CreateTensorboardRunRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3821,7 +3821,7 @@ async def test_create_tensorboard_run_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4030,7 +4030,7 @@ def test_batch_create_tensorboard_runs_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.BatchCreateTensorboardRunsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4048,7 +4048,7 @@ def test_batch_create_tensorboard_runs_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4062,7 +4062,7 @@ async def test_batch_create_tensorboard_runs_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.BatchCreateTensorboardRunsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4082,7 +4082,7 @@ async def test_batch_create_tensorboard_runs_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4311,7 +4311,7 @@ def test_get_tensorboard_run_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.GetTensorboardRunRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4329,7 +4329,7 @@ def test_get_tensorboard_run_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4343,7 +4343,7 @@ async def test_get_tensorboard_run_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.GetTensorboardRunRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4363,7 +4363,7 @@ async def test_get_tensorboard_run_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4570,7 +4570,7 @@ def test_update_tensorboard_run_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.UpdateTensorboardRunRequest() - request.tensorboard_run.name = "tensorboard_run.name/value" + request.tensorboard_run.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4588,7 +4588,7 @@ def test_update_tensorboard_run_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tensorboard_run.name=tensorboard_run.name/value", + "tensorboard_run.name=name_value", ) in kw["metadata"] @@ -4602,7 +4602,7 @@ async def test_update_tensorboard_run_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.UpdateTensorboardRunRequest() - request.tensorboard_run.name = "tensorboard_run.name/value" + request.tensorboard_run.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4622,7 +4622,7 @@ async def test_update_tensorboard_run_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tensorboard_run.name=tensorboard_run.name/value", + "tensorboard_run.name=name_value", ) in kw["metadata"] @@ -4827,7 +4827,7 @@ def test_list_tensorboard_runs_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.ListTensorboardRunsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4845,7 +4845,7 @@ def test_list_tensorboard_runs_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4859,7 +4859,7 @@ async def test_list_tensorboard_runs_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.ListTensorboardRunsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4879,7 +4879,7 @@ async def test_list_tensorboard_runs_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5016,7 +5016,7 @@ def test_list_tensorboard_runs_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, tensorboard_run.TensorboardRun) for i in results) @@ -5264,7 +5264,7 @@ def test_delete_tensorboard_run_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.DeleteTensorboardRunRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5282,7 +5282,7 @@ def test_delete_tensorboard_run_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5296,7 +5296,7 @@ async def test_delete_tensorboard_run_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.DeleteTensorboardRunRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5316,7 +5316,7 @@ async def test_delete_tensorboard_run_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5511,7 +5511,7 @@ def test_batch_create_tensorboard_time_series_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.BatchCreateTensorboardTimeSeriesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5531,7 +5531,7 @@ def test_batch_create_tensorboard_time_series_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5545,7 +5545,7 @@ async def test_batch_create_tensorboard_time_series_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.BatchCreateTensorboardTimeSeriesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5565,7 +5565,7 @@ async def test_batch_create_tensorboard_time_series_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5828,7 +5828,7 @@ def test_create_tensorboard_time_series_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.CreateTensorboardTimeSeriesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5846,7 +5846,7 @@ def test_create_tensorboard_time_series_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5860,7 +5860,7 @@ async def test_create_tensorboard_time_series_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.CreateTensorboardTimeSeriesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5880,7 +5880,7 @@ async def test_create_tensorboard_time_series_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -6123,7 +6123,7 @@ def test_get_tensorboard_time_series_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.GetTensorboardTimeSeriesRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6141,7 +6141,7 @@ def test_get_tensorboard_time_series_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -6155,7 +6155,7 @@ async def test_get_tensorboard_time_series_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.GetTensorboardTimeSeriesRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6175,7 +6175,7 @@ async def test_get_tensorboard_time_series_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -6400,7 +6400,7 @@ def test_update_tensorboard_time_series_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.UpdateTensorboardTimeSeriesRequest() - request.tensorboard_time_series.name = "tensorboard_time_series.name/value" + request.tensorboard_time_series.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6418,7 +6418,7 @@ def test_update_tensorboard_time_series_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tensorboard_time_series.name=tensorboard_time_series.name/value", + "tensorboard_time_series.name=name_value", ) in kw["metadata"] @@ -6432,7 +6432,7 @@ async def test_update_tensorboard_time_series_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.UpdateTensorboardTimeSeriesRequest() - request.tensorboard_time_series.name = "tensorboard_time_series.name/value" + request.tensorboard_time_series.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6452,7 +6452,7 @@ async def test_update_tensorboard_time_series_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tensorboard_time_series.name=tensorboard_time_series.name/value", + "tensorboard_time_series.name=name_value", ) in kw["metadata"] @@ -6665,7 +6665,7 @@ def test_list_tensorboard_time_series_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.ListTensorboardTimeSeriesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6683,7 +6683,7 @@ def test_list_tensorboard_time_series_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -6697,7 +6697,7 @@ async def test_list_tensorboard_time_series_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.ListTensorboardTimeSeriesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6717,7 +6717,7 @@ async def test_list_tensorboard_time_series_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -6854,7 +6854,7 @@ def test_list_tensorboard_time_series_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all( isinstance(i, tensorboard_time_series.TensorboardTimeSeries) @@ -7108,7 +7108,7 @@ def test_delete_tensorboard_time_series_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.DeleteTensorboardTimeSeriesRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7126,7 +7126,7 @@ def test_delete_tensorboard_time_series_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -7140,7 +7140,7 @@ async def test_delete_tensorboard_time_series_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.DeleteTensorboardTimeSeriesRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7160,7 +7160,7 @@ async def test_delete_tensorboard_time_series_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -7361,7 +7361,7 @@ def test_batch_read_tensorboard_time_series_data_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.BatchReadTensorboardTimeSeriesDataRequest() - request.tensorboard = "tensorboard/value" + request.tensorboard = "tensorboard_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7381,7 +7381,7 @@ def test_batch_read_tensorboard_time_series_data_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tensorboard=tensorboard/value", + "tensorboard=tensorboard_value", ) in kw["metadata"] @@ -7395,7 +7395,7 @@ async def test_batch_read_tensorboard_time_series_data_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.BatchReadTensorboardTimeSeriesDataRequest() - request.tensorboard = "tensorboard/value" + request.tensorboard = "tensorboard_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7415,7 +7415,7 @@ async def test_batch_read_tensorboard_time_series_data_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tensorboard=tensorboard/value", + "tensorboard=tensorboard_value", ) in kw["metadata"] @@ -7612,7 +7612,7 @@ def test_read_tensorboard_time_series_data_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.ReadTensorboardTimeSeriesDataRequest() - request.tensorboard_time_series = "tensorboard_time_series/value" + request.tensorboard_time_series = "tensorboard_time_series_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7630,7 +7630,7 @@ def test_read_tensorboard_time_series_data_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tensorboard_time_series=tensorboard_time_series/value", + "tensorboard_time_series=tensorboard_time_series_value", ) in kw["metadata"] @@ -7644,7 +7644,7 @@ async def test_read_tensorboard_time_series_data_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.ReadTensorboardTimeSeriesDataRequest() - request.tensorboard_time_series = "tensorboard_time_series/value" + request.tensorboard_time_series = "tensorboard_time_series_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7664,7 +7664,7 @@ async def test_read_tensorboard_time_series_data_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tensorboard_time_series=tensorboard_time_series/value", + "tensorboard_time_series=tensorboard_time_series_value", ) in kw["metadata"] @@ -7858,7 +7858,7 @@ def test_read_tensorboard_blob_data_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.ReadTensorboardBlobDataRequest() - request.time_series = "time_series/value" + request.time_series = "time_series_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7878,7 +7878,7 @@ def test_read_tensorboard_blob_data_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "time_series=time_series/value", + "time_series=time_series_value", ) in kw["metadata"] @@ -7892,7 +7892,7 @@ async def test_read_tensorboard_blob_data_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.ReadTensorboardBlobDataRequest() - request.time_series = "time_series/value" + request.time_series = "time_series_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7913,7 +7913,7 @@ async def test_read_tensorboard_blob_data_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "time_series=time_series/value", + "time_series=time_series_value", ) in kw["metadata"] @@ -8108,7 +8108,7 @@ def test_write_tensorboard_experiment_data_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.WriteTensorboardExperimentDataRequest() - request.tensorboard_experiment = "tensorboard_experiment/value" + request.tensorboard_experiment = "tensorboard_experiment_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8126,7 +8126,7 @@ def test_write_tensorboard_experiment_data_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tensorboard_experiment=tensorboard_experiment/value", + "tensorboard_experiment=tensorboard_experiment_value", ) in kw["metadata"] @@ -8140,7 +8140,7 @@ async def test_write_tensorboard_experiment_data_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.WriteTensorboardExperimentDataRequest() - request.tensorboard_experiment = "tensorboard_experiment/value" + request.tensorboard_experiment = "tensorboard_experiment_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8160,7 +8160,7 @@ async def test_write_tensorboard_experiment_data_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tensorboard_experiment=tensorboard_experiment/value", + "tensorboard_experiment=tensorboard_experiment_value", ) in kw["metadata"] @@ -8383,7 +8383,7 @@ def test_write_tensorboard_run_data_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.WriteTensorboardRunDataRequest() - request.tensorboard_run = "tensorboard_run/value" + request.tensorboard_run = "tensorboard_run_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8401,7 +8401,7 @@ def test_write_tensorboard_run_data_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tensorboard_run=tensorboard_run/value", + "tensorboard_run=tensorboard_run_value", ) in kw["metadata"] @@ -8415,7 +8415,7 @@ async def test_write_tensorboard_run_data_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.WriteTensorboardRunDataRequest() - request.tensorboard_run = "tensorboard_run/value" + request.tensorboard_run = "tensorboard_run_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8435,7 +8435,7 @@ async def test_write_tensorboard_run_data_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tensorboard_run=tensorboard_run/value", + "tensorboard_run=tensorboard_run_value", ) in kw["metadata"] @@ -8664,7 +8664,7 @@ def test_export_tensorboard_time_series_data_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.ExportTensorboardTimeSeriesDataRequest() - request.tensorboard_time_series = "tensorboard_time_series/value" + request.tensorboard_time_series = "tensorboard_time_series_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8684,7 +8684,7 @@ def test_export_tensorboard_time_series_data_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tensorboard_time_series=tensorboard_time_series/value", + "tensorboard_time_series=tensorboard_time_series_value", ) in kw["metadata"] @@ -8698,7 +8698,7 @@ async def test_export_tensorboard_time_series_data_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.ExportTensorboardTimeSeriesDataRequest() - request.tensorboard_time_series = "tensorboard_time_series/value" + request.tensorboard_time_series = "tensorboard_time_series_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8718,7 +8718,7 @@ async def test_export_tensorboard_time_series_data_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tensorboard_time_series=tensorboard_time_series/value", + "tensorboard_time_series=tensorboard_time_series_value", ) in kw["metadata"] @@ -8861,7 +8861,7 @@ def test_export_tensorboard_time_series_data_pager(transport_name: str = "grpc") assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, tensorboard_data.TimeSeriesDataPoint) for i in results) diff --git a/tests/unit/gapic/aiplatform_v1/test_vizier_service.py b/tests/unit/gapic/aiplatform_v1/test_vizier_service.py index 00a6a1b5dc..0c9bd53d79 100644 --- a/tests/unit/gapic/aiplatform_v1/test_vizier_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_vizier_service.py @@ -765,7 +765,7 @@ def test_create_study_field_headers(): # a field header. Set these to a non-empty value. request = vizier_service.CreateStudyRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_study), "__call__") as call: @@ -781,7 +781,7 @@ def test_create_study_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -795,7 +795,7 @@ async def test_create_study_field_headers_async(): # a field header. Set these to a non-empty value. request = vizier_service.CreateStudyRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_study), "__call__") as call: @@ -811,7 +811,7 @@ async def test_create_study_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1015,7 +1015,7 @@ def test_get_study_field_headers(): # a field header. Set these to a non-empty value. request = vizier_service.GetStudyRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_study), "__call__") as call: @@ -1031,7 +1031,7 @@ def test_get_study_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1045,7 +1045,7 @@ async def test_get_study_field_headers_async(): # a field header. Set these to a non-empty value. request = vizier_service.GetStudyRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_study), "__call__") as call: @@ -1061,7 +1061,7 @@ async def test_get_study_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1243,7 +1243,7 @@ def test_list_studies_field_headers(): # a field header. Set these to a non-empty value. request = vizier_service.ListStudiesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_studies), "__call__") as call: @@ -1259,7 +1259,7 @@ def test_list_studies_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1273,7 +1273,7 @@ async def test_list_studies_field_headers_async(): # a field header. Set these to a non-empty value. request = vizier_service.ListStudiesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_studies), "__call__") as call: @@ -1291,7 +1291,7 @@ async def test_list_studies_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1422,7 +1422,7 @@ def test_list_studies_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, study.Study) for i in results) @@ -1655,7 +1655,7 @@ def test_delete_study_field_headers(): # a field header. Set these to a non-empty value. request = vizier_service.DeleteStudyRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_study), "__call__") as call: @@ -1671,7 +1671,7 @@ def test_delete_study_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1685,7 +1685,7 @@ async def test_delete_study_field_headers_async(): # a field header. Set these to a non-empty value. request = vizier_service.DeleteStudyRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_study), "__call__") as call: @@ -1701,7 +1701,7 @@ async def test_delete_study_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1895,7 +1895,7 @@ def test_lookup_study_field_headers(): # a field header. Set these to a non-empty value. request = vizier_service.LookupStudyRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.lookup_study), "__call__") as call: @@ -1911,7 +1911,7 @@ def test_lookup_study_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1925,7 +1925,7 @@ async def test_lookup_study_field_headers_async(): # a field header. Set these to a non-empty value. request = vizier_service.LookupStudyRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.lookup_study), "__call__") as call: @@ -1941,7 +1941,7 @@ async def test_lookup_study_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2117,7 +2117,7 @@ def test_suggest_trials_field_headers(): # a field header. Set these to a non-empty value. request = vizier_service.SuggestTrialsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.suggest_trials), "__call__") as call: @@ -2133,7 +2133,7 @@ def test_suggest_trials_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2147,7 +2147,7 @@ async def test_suggest_trials_field_headers_async(): # a field header. Set these to a non-empty value. request = vizier_service.SuggestTrialsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.suggest_trials), "__call__") as call: @@ -2165,7 +2165,7 @@ async def test_suggest_trials_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2287,7 +2287,7 @@ def test_create_trial_field_headers(): # a field header. Set these to a non-empty value. request = vizier_service.CreateTrialRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_trial), "__call__") as call: @@ -2303,7 +2303,7 @@ def test_create_trial_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2317,7 +2317,7 @@ async def test_create_trial_field_headers_async(): # a field header. Set these to a non-empty value. request = vizier_service.CreateTrialRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_trial), "__call__") as call: @@ -2333,7 +2333,7 @@ async def test_create_trial_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2545,7 +2545,7 @@ def test_get_trial_field_headers(): # a field header. Set these to a non-empty value. request = vizier_service.GetTrialRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_trial), "__call__") as call: @@ -2561,7 +2561,7 @@ def test_get_trial_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2575,7 +2575,7 @@ async def test_get_trial_field_headers_async(): # a field header. Set these to a non-empty value. request = vizier_service.GetTrialRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_trial), "__call__") as call: @@ -2591,7 +2591,7 @@ async def test_get_trial_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2773,7 +2773,7 @@ def test_list_trials_field_headers(): # a field header. Set these to a non-empty value. request = vizier_service.ListTrialsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_trials), "__call__") as call: @@ -2789,7 +2789,7 @@ def test_list_trials_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2803,7 +2803,7 @@ async def test_list_trials_field_headers_async(): # a field header. Set these to a non-empty value. request = vizier_service.ListTrialsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_trials), "__call__") as call: @@ -2821,7 +2821,7 @@ async def test_list_trials_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2952,7 +2952,7 @@ def test_list_trials_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, study.Trial) for i in results) @@ -3220,7 +3220,7 @@ def test_add_trial_measurement_field_headers(): # a field header. Set these to a non-empty value. request = vizier_service.AddTrialMeasurementRequest() - request.trial_name = "trial_name/value" + request.trial_name = "trial_name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3238,7 +3238,7 @@ def test_add_trial_measurement_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "trial_name=trial_name/value", + "trial_name=trial_name_value", ) in kw["metadata"] @@ -3252,7 +3252,7 @@ async def test_add_trial_measurement_field_headers_async(): # a field header. Set these to a non-empty value. request = vizier_service.AddTrialMeasurementRequest() - request.trial_name = "trial_name/value" + request.trial_name = "trial_name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3270,7 +3270,7 @@ async def test_add_trial_measurement_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "trial_name=trial_name/value", + "trial_name=trial_name_value", ) in kw["metadata"] @@ -3392,7 +3392,7 @@ def test_complete_trial_field_headers(): # a field header. Set these to a non-empty value. request = vizier_service.CompleteTrialRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.complete_trial), "__call__") as call: @@ -3408,7 +3408,7 @@ def test_complete_trial_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3422,7 +3422,7 @@ async def test_complete_trial_field_headers_async(): # a field header. Set these to a non-empty value. request = vizier_service.CompleteTrialRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.complete_trial), "__call__") as call: @@ -3438,7 +3438,7 @@ async def test_complete_trial_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3532,7 +3532,7 @@ def test_delete_trial_field_headers(): # a field header. Set these to a non-empty value. request = vizier_service.DeleteTrialRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_trial), "__call__") as call: @@ -3548,7 +3548,7 @@ def test_delete_trial_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3562,7 +3562,7 @@ async def test_delete_trial_field_headers_async(): # a field header. Set these to a non-empty value. request = vizier_service.DeleteTrialRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_trial), "__call__") as call: @@ -3578,7 +3578,7 @@ async def test_delete_trial_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3761,7 +3761,7 @@ def test_check_trial_early_stopping_state_field_headers(): # a field header. Set these to a non-empty value. request = vizier_service.CheckTrialEarlyStoppingStateRequest() - request.trial_name = "trial_name/value" + request.trial_name = "trial_name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3779,7 +3779,7 @@ def test_check_trial_early_stopping_state_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "trial_name=trial_name/value", + "trial_name=trial_name_value", ) in kw["metadata"] @@ -3793,7 +3793,7 @@ async def test_check_trial_early_stopping_state_field_headers_async(): # a field header. Set these to a non-empty value. request = vizier_service.CheckTrialEarlyStoppingStateRequest() - request.trial_name = "trial_name/value" + request.trial_name = "trial_name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3813,7 +3813,7 @@ async def test_check_trial_early_stopping_state_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "trial_name=trial_name/value", + "trial_name=trial_name_value", ) in kw["metadata"] @@ -3935,7 +3935,7 @@ def test_stop_trial_field_headers(): # a field header. Set these to a non-empty value. request = vizier_service.StopTrialRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.stop_trial), "__call__") as call: @@ -3951,7 +3951,7 @@ def test_stop_trial_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3965,7 +3965,7 @@ async def test_stop_trial_field_headers_async(): # a field header. Set these to a non-empty value. request = vizier_service.StopTrialRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.stop_trial), "__call__") as call: @@ -3981,7 +3981,7 @@ async def test_stop_trial_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4084,7 +4084,7 @@ def test_list_optimal_trials_field_headers(): # a field header. Set these to a non-empty value. request = vizier_service.ListOptimalTrialsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4102,7 +4102,7 @@ def test_list_optimal_trials_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4116,7 +4116,7 @@ async def test_list_optimal_trials_field_headers_async(): # a field header. Set these to a non-empty value. request = vizier_service.ListOptimalTrialsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4136,7 +4136,7 @@ async def test_list_optimal_trials_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_dataset_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_dataset_service.py index 244de7ddb9..469624d9b5 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_dataset_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_dataset_service.py @@ -757,7 +757,7 @@ def test_create_dataset_field_headers(): # a field header. Set these to a non-empty value. request = dataset_service.CreateDatasetRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_dataset), "__call__") as call: @@ -773,7 +773,7 @@ def test_create_dataset_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -787,7 +787,7 @@ async def test_create_dataset_field_headers_async(): # a field header. Set these to a non-empty value. request = dataset_service.CreateDatasetRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_dataset), "__call__") as call: @@ -805,7 +805,7 @@ async def test_create_dataset_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1015,7 +1015,7 @@ def test_get_dataset_field_headers(): # a field header. Set these to a non-empty value. request = dataset_service.GetDatasetRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_dataset), "__call__") as call: @@ -1031,7 +1031,7 @@ def test_get_dataset_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1045,7 +1045,7 @@ async def test_get_dataset_field_headers_async(): # a field header. Set these to a non-empty value. request = dataset_service.GetDatasetRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_dataset), "__call__") as call: @@ -1061,7 +1061,7 @@ async def test_get_dataset_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1259,7 +1259,7 @@ def test_update_dataset_field_headers(): # a field header. Set these to a non-empty value. request = dataset_service.UpdateDatasetRequest() - request.dataset.name = "dataset.name/value" + request.dataset.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_dataset), "__call__") as call: @@ -1275,7 +1275,7 @@ def test_update_dataset_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "dataset.name=dataset.name/value", + "dataset.name=name_value", ) in kw["metadata"] @@ -1289,7 +1289,7 @@ async def test_update_dataset_field_headers_async(): # a field header. Set these to a non-empty value. request = dataset_service.UpdateDatasetRequest() - request.dataset.name = "dataset.name/value" + request.dataset.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_dataset), "__call__") as call: @@ -1305,7 +1305,7 @@ async def test_update_dataset_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "dataset.name=dataset.name/value", + "dataset.name=name_value", ) in kw["metadata"] @@ -1497,7 +1497,7 @@ def test_list_datasets_field_headers(): # a field header. Set these to a non-empty value. request = dataset_service.ListDatasetsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_datasets), "__call__") as call: @@ -1513,7 +1513,7 @@ def test_list_datasets_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1527,7 +1527,7 @@ async def test_list_datasets_field_headers_async(): # a field header. Set these to a non-empty value. request = dataset_service.ListDatasetsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_datasets), "__call__") as call: @@ -1545,7 +1545,7 @@ async def test_list_datasets_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1676,7 +1676,7 @@ def test_list_datasets_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, dataset.Dataset) for i in results) @@ -1911,7 +1911,7 @@ def test_delete_dataset_field_headers(): # a field header. Set these to a non-empty value. request = dataset_service.DeleteDatasetRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_dataset), "__call__") as call: @@ -1927,7 +1927,7 @@ def test_delete_dataset_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1941,7 +1941,7 @@ async def test_delete_dataset_field_headers_async(): # a field header. Set these to a non-empty value. request = dataset_service.DeleteDatasetRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_dataset), "__call__") as call: @@ -1959,7 +1959,7 @@ async def test_delete_dataset_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2137,7 +2137,7 @@ def test_import_data_field_headers(): # a field header. Set these to a non-empty value. request = dataset_service.ImportDataRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.import_data), "__call__") as call: @@ -2153,7 +2153,7 @@ def test_import_data_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2167,7 +2167,7 @@ async def test_import_data_field_headers_async(): # a field header. Set these to a non-empty value. request = dataset_service.ImportDataRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.import_data), "__call__") as call: @@ -2185,7 +2185,7 @@ async def test_import_data_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2385,7 +2385,7 @@ def test_export_data_field_headers(): # a field header. Set these to a non-empty value. request = dataset_service.ExportDataRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.export_data), "__call__") as call: @@ -2401,7 +2401,7 @@ def test_export_data_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2415,7 +2415,7 @@ async def test_export_data_field_headers_async(): # a field header. Set these to a non-empty value. request = dataset_service.ExportDataRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.export_data), "__call__") as call: @@ -2433,7 +2433,7 @@ async def test_export_data_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2651,7 +2651,7 @@ def test_list_data_items_field_headers(): # a field header. Set these to a non-empty value. request = dataset_service.ListDataItemsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_data_items), "__call__") as call: @@ -2667,7 +2667,7 @@ def test_list_data_items_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2681,7 +2681,7 @@ async def test_list_data_items_field_headers_async(): # a field header. Set these to a non-empty value. request = dataset_service.ListDataItemsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_data_items), "__call__") as call: @@ -2699,7 +2699,7 @@ async def test_list_data_items_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2830,7 +2830,7 @@ def test_list_data_items_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, data_item.DataItem) for i in results) @@ -3086,7 +3086,7 @@ def test_get_annotation_spec_field_headers(): # a field header. Set these to a non-empty value. request = dataset_service.GetAnnotationSpecRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3104,7 +3104,7 @@ def test_get_annotation_spec_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3118,7 +3118,7 @@ async def test_get_annotation_spec_field_headers_async(): # a field header. Set these to a non-empty value. request = dataset_service.GetAnnotationSpecRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3138,7 +3138,7 @@ async def test_get_annotation_spec_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3326,7 +3326,7 @@ def test_list_annotations_field_headers(): # a field header. Set these to a non-empty value. request = dataset_service.ListAnnotationsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_annotations), "__call__") as call: @@ -3342,7 +3342,7 @@ def test_list_annotations_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3356,7 +3356,7 @@ async def test_list_annotations_field_headers_async(): # a field header. Set these to a non-empty value. request = dataset_service.ListAnnotationsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_annotations), "__call__") as call: @@ -3374,7 +3374,7 @@ async def test_list_annotations_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3505,7 +3505,7 @@ def test_list_annotations_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, annotation.Annotation) for i in results) diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_endpoint_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_endpoint_service.py index 2249c3e592..6900f5853c 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_endpoint_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_endpoint_service.py @@ -772,7 +772,7 @@ def test_create_endpoint_field_headers(): # a field header. Set these to a non-empty value. request = endpoint_service.CreateEndpointRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_endpoint), "__call__") as call: @@ -788,7 +788,7 @@ def test_create_endpoint_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -802,7 +802,7 @@ async def test_create_endpoint_field_headers_async(): # a field header. Set these to a non-empty value. request = endpoint_service.CreateEndpointRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_endpoint), "__call__") as call: @@ -820,7 +820,7 @@ async def test_create_endpoint_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1054,7 +1054,7 @@ def test_get_endpoint_field_headers(): # a field header. Set these to a non-empty value. request = endpoint_service.GetEndpointRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_endpoint), "__call__") as call: @@ -1070,7 +1070,7 @@ def test_get_endpoint_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1084,7 +1084,7 @@ async def test_get_endpoint_field_headers_async(): # a field header. Set these to a non-empty value. request = endpoint_service.GetEndpointRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_endpoint), "__call__") as call: @@ -1100,7 +1100,7 @@ async def test_get_endpoint_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1282,7 +1282,7 @@ def test_list_endpoints_field_headers(): # a field header. Set these to a non-empty value. request = endpoint_service.ListEndpointsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_endpoints), "__call__") as call: @@ -1298,7 +1298,7 @@ def test_list_endpoints_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1312,7 +1312,7 @@ async def test_list_endpoints_field_headers_async(): # a field header. Set these to a non-empty value. request = endpoint_service.ListEndpointsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_endpoints), "__call__") as call: @@ -1330,7 +1330,7 @@ async def test_list_endpoints_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1461,7 +1461,7 @@ def test_list_endpoints_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, endpoint.Endpoint) for i in results) @@ -1732,7 +1732,7 @@ def test_update_endpoint_field_headers(): # a field header. Set these to a non-empty value. request = endpoint_service.UpdateEndpointRequest() - request.endpoint.name = "endpoint.name/value" + request.endpoint.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_endpoint), "__call__") as call: @@ -1748,7 +1748,7 @@ def test_update_endpoint_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "endpoint.name=endpoint.name/value", + "endpoint.name=name_value", ) in kw["metadata"] @@ -1762,7 +1762,7 @@ async def test_update_endpoint_field_headers_async(): # a field header. Set these to a non-empty value. request = endpoint_service.UpdateEndpointRequest() - request.endpoint.name = "endpoint.name/value" + request.endpoint.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_endpoint), "__call__") as call: @@ -1780,7 +1780,7 @@ async def test_update_endpoint_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "endpoint.name=endpoint.name/value", + "endpoint.name=name_value", ) in kw["metadata"] @@ -1968,7 +1968,7 @@ def test_delete_endpoint_field_headers(): # a field header. Set these to a non-empty value. request = endpoint_service.DeleteEndpointRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_endpoint), "__call__") as call: @@ -1984,7 +1984,7 @@ def test_delete_endpoint_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1998,7 +1998,7 @@ async def test_delete_endpoint_field_headers_async(): # a field header. Set these to a non-empty value. request = endpoint_service.DeleteEndpointRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_endpoint), "__call__") as call: @@ -2016,7 +2016,7 @@ async def test_delete_endpoint_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2194,7 +2194,7 @@ def test_deploy_model_field_headers(): # a field header. Set these to a non-empty value. request = endpoint_service.DeployModelRequest() - request.endpoint = "endpoint/value" + request.endpoint = "endpoint_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.deploy_model), "__call__") as call: @@ -2210,7 +2210,7 @@ def test_deploy_model_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "endpoint=endpoint/value", + "endpoint=endpoint_value", ) in kw["metadata"] @@ -2224,7 +2224,7 @@ async def test_deploy_model_field_headers_async(): # a field header. Set these to a non-empty value. request = endpoint_service.DeployModelRequest() - request.endpoint = "endpoint/value" + request.endpoint = "endpoint_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.deploy_model), "__call__") as call: @@ -2242,7 +2242,7 @@ async def test_deploy_model_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "endpoint=endpoint/value", + "endpoint=endpoint_value", ) in kw["metadata"] @@ -2476,7 +2476,7 @@ def test_undeploy_model_field_headers(): # a field header. Set these to a non-empty value. request = endpoint_service.UndeployModelRequest() - request.endpoint = "endpoint/value" + request.endpoint = "endpoint_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.undeploy_model), "__call__") as call: @@ -2492,7 +2492,7 @@ def test_undeploy_model_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "endpoint=endpoint/value", + "endpoint=endpoint_value", ) in kw["metadata"] @@ -2506,7 +2506,7 @@ async def test_undeploy_model_field_headers_async(): # a field header. Set these to a non-empty value. request = endpoint_service.UndeployModelRequest() - request.endpoint = "endpoint/value" + request.endpoint = "endpoint_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.undeploy_model), "__call__") as call: @@ -2524,7 +2524,7 @@ async def test_undeploy_model_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "endpoint=endpoint/value", + "endpoint=endpoint_value", ) in kw["metadata"] diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_featurestore_online_serving_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_featurestore_online_serving_service.py index 409363dbe9..b216ab128b 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_featurestore_online_serving_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_featurestore_online_serving_service.py @@ -794,7 +794,7 @@ def test_read_feature_values_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_online_service.ReadFeatureValuesRequest() - request.entity_type = "entity_type/value" + request.entity_type = "entity_type_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -812,7 +812,7 @@ def test_read_feature_values_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "entity_type=entity_type/value", + "entity_type=entity_type_value", ) in kw["metadata"] @@ -826,7 +826,7 @@ async def test_read_feature_values_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_online_service.ReadFeatureValuesRequest() - request.entity_type = "entity_type/value" + request.entity_type = "entity_type_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -846,7 +846,7 @@ async def test_read_feature_values_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "entity_type=entity_type/value", + "entity_type=entity_type_value", ) in kw["metadata"] @@ -1048,7 +1048,7 @@ def test_streaming_read_feature_values_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_online_service.StreamingReadFeatureValuesRequest() - request.entity_type = "entity_type/value" + request.entity_type = "entity_type_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1068,7 +1068,7 @@ def test_streaming_read_feature_values_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "entity_type=entity_type/value", + "entity_type=entity_type_value", ) in kw["metadata"] @@ -1082,7 +1082,7 @@ async def test_streaming_read_feature_values_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_online_service.StreamingReadFeatureValuesRequest() - request.entity_type = "entity_type/value" + request.entity_type = "entity_type_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1103,7 +1103,7 @@ async def test_streaming_read_feature_values_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "entity_type=entity_type/value", + "entity_type=entity_type_value", ) in kw["metadata"] diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_featurestore_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_featurestore_service.py index 5aa43d8485..b29bba1435 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_featurestore_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_featurestore_service.py @@ -791,7 +791,7 @@ def test_create_featurestore_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_service.CreateFeaturestoreRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -809,7 +809,7 @@ def test_create_featurestore_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -823,7 +823,7 @@ async def test_create_featurestore_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_service.CreateFeaturestoreRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -843,7 +843,7 @@ async def test_create_featurestore_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1060,7 +1060,7 @@ def test_get_featurestore_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_service.GetFeaturestoreRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_featurestore), "__call__") as call: @@ -1076,7 +1076,7 @@ def test_get_featurestore_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1090,7 +1090,7 @@ async def test_get_featurestore_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_service.GetFeaturestoreRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_featurestore), "__call__") as call: @@ -1108,7 +1108,7 @@ async def test_get_featurestore_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1299,7 +1299,7 @@ def test_list_featurestores_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_service.ListFeaturestoresRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1317,7 +1317,7 @@ def test_list_featurestores_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1331,7 +1331,7 @@ async def test_list_featurestores_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_service.ListFeaturestoresRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1351,7 +1351,7 @@ async def test_list_featurestores_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1488,7 +1488,7 @@ def test_list_featurestores_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, featurestore.Featurestore) for i in results) @@ -1736,7 +1736,7 @@ def test_update_featurestore_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_service.UpdateFeaturestoreRequest() - request.featurestore.name = "featurestore.name/value" + request.featurestore.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1754,7 +1754,7 @@ def test_update_featurestore_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "featurestore.name=featurestore.name/value", + "featurestore.name=name_value", ) in kw["metadata"] @@ -1768,7 +1768,7 @@ async def test_update_featurestore_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_service.UpdateFeaturestoreRequest() - request.featurestore.name = "featurestore.name/value" + request.featurestore.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1788,7 +1788,7 @@ async def test_update_featurestore_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "featurestore.name=featurestore.name/value", + "featurestore.name=name_value", ) in kw["metadata"] @@ -1987,7 +1987,7 @@ def test_delete_featurestore_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_service.DeleteFeaturestoreRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2005,7 +2005,7 @@ def test_delete_featurestore_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2019,7 +2019,7 @@ async def test_delete_featurestore_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_service.DeleteFeaturestoreRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2039,7 +2039,7 @@ async def test_delete_featurestore_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2238,7 +2238,7 @@ def test_create_entity_type_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_service.CreateEntityTypeRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2256,7 +2256,7 @@ def test_create_entity_type_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2270,7 +2270,7 @@ async def test_create_entity_type_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_service.CreateEntityTypeRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2290,7 +2290,7 @@ async def test_create_entity_type_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2507,7 +2507,7 @@ def test_get_entity_type_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_service.GetEntityTypeRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_entity_type), "__call__") as call: @@ -2523,7 +2523,7 @@ def test_get_entity_type_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2537,7 +2537,7 @@ async def test_get_entity_type_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_service.GetEntityTypeRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_entity_type), "__call__") as call: @@ -2555,7 +2555,7 @@ async def test_get_entity_type_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2746,7 +2746,7 @@ def test_list_entity_types_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_service.ListEntityTypesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2764,7 +2764,7 @@ def test_list_entity_types_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2778,7 +2778,7 @@ async def test_list_entity_types_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_service.ListEntityTypesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2798,7 +2798,7 @@ async def test_list_entity_types_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2935,7 +2935,7 @@ def test_list_entity_types_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, entity_type.EntityType) for i in results) @@ -3197,7 +3197,7 @@ def test_update_entity_type_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_service.UpdateEntityTypeRequest() - request.entity_type.name = "entity_type.name/value" + request.entity_type.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3215,7 +3215,7 @@ def test_update_entity_type_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "entity_type.name=entity_type.name/value", + "entity_type.name=name_value", ) in kw["metadata"] @@ -3229,7 +3229,7 @@ async def test_update_entity_type_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_service.UpdateEntityTypeRequest() - request.entity_type.name = "entity_type.name/value" + request.entity_type.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3249,7 +3249,7 @@ async def test_update_entity_type_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "entity_type.name=entity_type.name/value", + "entity_type.name=name_value", ) in kw["metadata"] @@ -3448,7 +3448,7 @@ def test_delete_entity_type_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_service.DeleteEntityTypeRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3466,7 +3466,7 @@ def test_delete_entity_type_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3480,7 +3480,7 @@ async def test_delete_entity_type_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_service.DeleteEntityTypeRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3500,7 +3500,7 @@ async def test_delete_entity_type_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3693,7 +3693,7 @@ def test_create_feature_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_service.CreateFeatureRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_feature), "__call__") as call: @@ -3709,7 +3709,7 @@ def test_create_feature_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3723,7 +3723,7 @@ async def test_create_feature_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_service.CreateFeatureRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_feature), "__call__") as call: @@ -3741,7 +3741,7 @@ async def test_create_feature_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3946,7 +3946,7 @@ def test_batch_create_features_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_service.BatchCreateFeaturesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3964,7 +3964,7 @@ def test_batch_create_features_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3978,7 +3978,7 @@ async def test_batch_create_features_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_service.BatchCreateFeaturesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3998,7 +3998,7 @@ async def test_batch_create_features_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4212,7 +4212,7 @@ def test_get_feature_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_service.GetFeatureRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_feature), "__call__") as call: @@ -4228,7 +4228,7 @@ def test_get_feature_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4242,7 +4242,7 @@ async def test_get_feature_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_service.GetFeatureRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_feature), "__call__") as call: @@ -4258,7 +4258,7 @@ async def test_get_feature_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4441,7 +4441,7 @@ def test_list_features_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_service.ListFeaturesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_features), "__call__") as call: @@ -4457,7 +4457,7 @@ def test_list_features_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4471,7 +4471,7 @@ async def test_list_features_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_service.ListFeaturesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_features), "__call__") as call: @@ -4489,7 +4489,7 @@ async def test_list_features_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4620,7 +4620,7 @@ def test_list_features_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, feature.Feature) for i in results) @@ -4878,7 +4878,7 @@ def test_update_feature_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_service.UpdateFeatureRequest() - request.feature.name = "feature.name/value" + request.feature.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_feature), "__call__") as call: @@ -4894,7 +4894,7 @@ def test_update_feature_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "feature.name=feature.name/value", + "feature.name=name_value", ) in kw["metadata"] @@ -4908,7 +4908,7 @@ async def test_update_feature_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_service.UpdateFeatureRequest() - request.feature.name = "feature.name/value" + request.feature.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_feature), "__call__") as call: @@ -4924,7 +4924,7 @@ async def test_update_feature_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "feature.name=feature.name/value", + "feature.name=name_value", ) in kw["metadata"] @@ -5111,7 +5111,7 @@ def test_delete_feature_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_service.DeleteFeatureRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_feature), "__call__") as call: @@ -5127,7 +5127,7 @@ def test_delete_feature_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5141,7 +5141,7 @@ async def test_delete_feature_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_service.DeleteFeatureRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_feature), "__call__") as call: @@ -5159,7 +5159,7 @@ async def test_delete_feature_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5344,7 +5344,7 @@ def test_import_feature_values_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_service.ImportFeatureValuesRequest() - request.entity_type = "entity_type/value" + request.entity_type = "entity_type_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5362,7 +5362,7 @@ def test_import_feature_values_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "entity_type=entity_type/value", + "entity_type=entity_type_value", ) in kw["metadata"] @@ -5376,7 +5376,7 @@ async def test_import_feature_values_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_service.ImportFeatureValuesRequest() - request.entity_type = "entity_type/value" + request.entity_type = "entity_type_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5396,7 +5396,7 @@ async def test_import_feature_values_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "entity_type=entity_type/value", + "entity_type=entity_type_value", ) in kw["metadata"] @@ -5585,7 +5585,7 @@ def test_batch_read_feature_values_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_service.BatchReadFeatureValuesRequest() - request.featurestore = "featurestore/value" + request.featurestore = "featurestore_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5603,7 +5603,7 @@ def test_batch_read_feature_values_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "featurestore=featurestore/value", + "featurestore=featurestore_value", ) in kw["metadata"] @@ -5617,7 +5617,7 @@ async def test_batch_read_feature_values_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_service.BatchReadFeatureValuesRequest() - request.featurestore = "featurestore/value" + request.featurestore = "featurestore_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5637,7 +5637,7 @@ async def test_batch_read_feature_values_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "featurestore=featurestore/value", + "featurestore=featurestore_value", ) in kw["metadata"] @@ -5826,7 +5826,7 @@ def test_export_feature_values_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_service.ExportFeatureValuesRequest() - request.entity_type = "entity_type/value" + request.entity_type = "entity_type_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5844,7 +5844,7 @@ def test_export_feature_values_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "entity_type=entity_type/value", + "entity_type=entity_type_value", ) in kw["metadata"] @@ -5858,7 +5858,7 @@ async def test_export_feature_values_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_service.ExportFeatureValuesRequest() - request.entity_type = "entity_type/value" + request.entity_type = "entity_type_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5878,7 +5878,7 @@ async def test_export_feature_values_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "entity_type=entity_type/value", + "entity_type=entity_type_value", ) in kw["metadata"] @@ -6067,7 +6067,7 @@ def test_search_features_field_headers(): # a field header. Set these to a non-empty value. request = featurestore_service.SearchFeaturesRequest() - request.location = "location/value" + request.location = "location_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.search_features), "__call__") as call: @@ -6083,7 +6083,7 @@ def test_search_features_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "location=location/value", + "location=location_value", ) in kw["metadata"] @@ -6097,7 +6097,7 @@ async def test_search_features_field_headers_async(): # a field header. Set these to a non-empty value. request = featurestore_service.SearchFeaturesRequest() - request.location = "location/value" + request.location = "location_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.search_features), "__call__") as call: @@ -6115,7 +6115,7 @@ async def test_search_features_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "location=location/value", + "location=location_value", ) in kw["metadata"] @@ -6256,7 +6256,7 @@ def test_search_features_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, feature.Feature) for i in results) diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_index_endpoint_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_index_endpoint_service.py index 99b3db3ec9..41485dea9c 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_index_endpoint_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_index_endpoint_service.py @@ -783,7 +783,7 @@ def test_create_index_endpoint_field_headers(): # a field header. Set these to a non-empty value. request = index_endpoint_service.CreateIndexEndpointRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -801,7 +801,7 @@ def test_create_index_endpoint_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -815,7 +815,7 @@ async def test_create_index_endpoint_field_headers_async(): # a field header. Set these to a non-empty value. request = index_endpoint_service.CreateIndexEndpointRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -835,7 +835,7 @@ async def test_create_index_endpoint_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1060,7 +1060,7 @@ def test_get_index_endpoint_field_headers(): # a field header. Set these to a non-empty value. request = index_endpoint_service.GetIndexEndpointRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1078,7 +1078,7 @@ def test_get_index_endpoint_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1092,7 +1092,7 @@ async def test_get_index_endpoint_field_headers_async(): # a field header. Set these to a non-empty value. request = index_endpoint_service.GetIndexEndpointRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1112,7 +1112,7 @@ async def test_get_index_endpoint_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1307,7 +1307,7 @@ def test_list_index_endpoints_field_headers(): # a field header. Set these to a non-empty value. request = index_endpoint_service.ListIndexEndpointsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1325,7 +1325,7 @@ def test_list_index_endpoints_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1339,7 +1339,7 @@ async def test_list_index_endpoints_field_headers_async(): # a field header. Set these to a non-empty value. request = index_endpoint_service.ListIndexEndpointsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1359,7 +1359,7 @@ async def test_list_index_endpoints_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1496,7 +1496,7 @@ def test_list_index_endpoints_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, index_endpoint.IndexEndpoint) for i in results) @@ -1770,7 +1770,7 @@ def test_update_index_endpoint_field_headers(): # a field header. Set these to a non-empty value. request = index_endpoint_service.UpdateIndexEndpointRequest() - request.index_endpoint.name = "index_endpoint.name/value" + request.index_endpoint.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1788,7 +1788,7 @@ def test_update_index_endpoint_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "index_endpoint.name=index_endpoint.name/value", + "index_endpoint.name=name_value", ) in kw["metadata"] @@ -1802,7 +1802,7 @@ async def test_update_index_endpoint_field_headers_async(): # a field header. Set these to a non-empty value. request = index_endpoint_service.UpdateIndexEndpointRequest() - request.index_endpoint.name = "index_endpoint.name/value" + request.index_endpoint.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1822,7 +1822,7 @@ async def test_update_index_endpoint_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "index_endpoint.name=index_endpoint.name/value", + "index_endpoint.name=name_value", ) in kw["metadata"] @@ -2021,7 +2021,7 @@ def test_delete_index_endpoint_field_headers(): # a field header. Set these to a non-empty value. request = index_endpoint_service.DeleteIndexEndpointRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2039,7 +2039,7 @@ def test_delete_index_endpoint_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2053,7 +2053,7 @@ async def test_delete_index_endpoint_field_headers_async(): # a field header. Set these to a non-empty value. request = index_endpoint_service.DeleteIndexEndpointRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2073,7 +2073,7 @@ async def test_delete_index_endpoint_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2256,7 +2256,7 @@ def test_deploy_index_field_headers(): # a field header. Set these to a non-empty value. request = index_endpoint_service.DeployIndexRequest() - request.index_endpoint = "index_endpoint/value" + request.index_endpoint = "index_endpoint_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.deploy_index), "__call__") as call: @@ -2272,7 +2272,7 @@ def test_deploy_index_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "index_endpoint=index_endpoint/value", + "index_endpoint=index_endpoint_value", ) in kw["metadata"] @@ -2286,7 +2286,7 @@ async def test_deploy_index_field_headers_async(): # a field header. Set these to a non-empty value. request = index_endpoint_service.DeployIndexRequest() - request.index_endpoint = "index_endpoint/value" + request.index_endpoint = "index_endpoint_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.deploy_index), "__call__") as call: @@ -2304,7 +2304,7 @@ async def test_deploy_index_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "index_endpoint=index_endpoint/value", + "index_endpoint=index_endpoint_value", ) in kw["metadata"] @@ -2493,7 +2493,7 @@ def test_undeploy_index_field_headers(): # a field header. Set these to a non-empty value. request = index_endpoint_service.UndeployIndexRequest() - request.index_endpoint = "index_endpoint/value" + request.index_endpoint = "index_endpoint_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.undeploy_index), "__call__") as call: @@ -2509,7 +2509,7 @@ def test_undeploy_index_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "index_endpoint=index_endpoint/value", + "index_endpoint=index_endpoint_value", ) in kw["metadata"] @@ -2523,7 +2523,7 @@ async def test_undeploy_index_field_headers_async(): # a field header. Set these to a non-empty value. request = index_endpoint_service.UndeployIndexRequest() - request.index_endpoint = "index_endpoint/value" + request.index_endpoint = "index_endpoint_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.undeploy_index), "__call__") as call: @@ -2541,7 +2541,7 @@ async def test_undeploy_index_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "index_endpoint=index_endpoint/value", + "index_endpoint=index_endpoint_value", ) in kw["metadata"] @@ -2736,7 +2736,7 @@ def test_mutate_deployed_index_field_headers(): # a field header. Set these to a non-empty value. request = index_endpoint_service.MutateDeployedIndexRequest() - request.index_endpoint = "index_endpoint/value" + request.index_endpoint = "index_endpoint_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2754,7 +2754,7 @@ def test_mutate_deployed_index_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "index_endpoint=index_endpoint/value", + "index_endpoint=index_endpoint_value", ) in kw["metadata"] @@ -2768,7 +2768,7 @@ async def test_mutate_deployed_index_field_headers_async(): # a field header. Set these to a non-empty value. request = index_endpoint_service.MutateDeployedIndexRequest() - request.index_endpoint = "index_endpoint/value" + request.index_endpoint = "index_endpoint_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2788,7 +2788,7 @@ async def test_mutate_deployed_index_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "index_endpoint=index_endpoint/value", + "index_endpoint=index_endpoint_value", ) in kw["metadata"] diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_index_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_index_service.py index b909b9f52a..f163aaa75a 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_index_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_index_service.py @@ -738,7 +738,7 @@ def test_create_index_field_headers(): # a field header. Set these to a non-empty value. request = index_service.CreateIndexRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_index), "__call__") as call: @@ -754,7 +754,7 @@ def test_create_index_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -768,7 +768,7 @@ async def test_create_index_field_headers_async(): # a field header. Set these to a non-empty value. request = index_service.CreateIndexRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_index), "__call__") as call: @@ -786,7 +786,7 @@ async def test_create_index_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -996,7 +996,7 @@ def test_get_index_field_headers(): # a field header. Set these to a non-empty value. request = index_service.GetIndexRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_index), "__call__") as call: @@ -1012,7 +1012,7 @@ def test_get_index_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1026,7 +1026,7 @@ async def test_get_index_field_headers_async(): # a field header. Set these to a non-empty value. request = index_service.GetIndexRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_index), "__call__") as call: @@ -1042,7 +1042,7 @@ async def test_get_index_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1224,7 +1224,7 @@ def test_list_indexes_field_headers(): # a field header. Set these to a non-empty value. request = index_service.ListIndexesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_indexes), "__call__") as call: @@ -1240,7 +1240,7 @@ def test_list_indexes_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1254,7 +1254,7 @@ async def test_list_indexes_field_headers_async(): # a field header. Set these to a non-empty value. request = index_service.ListIndexesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_indexes), "__call__") as call: @@ -1272,7 +1272,7 @@ async def test_list_indexes_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1403,7 +1403,7 @@ def test_list_indexes_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, index.Index) for i in results) @@ -1638,7 +1638,7 @@ def test_update_index_field_headers(): # a field header. Set these to a non-empty value. request = index_service.UpdateIndexRequest() - request.index.name = "index.name/value" + request.index.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_index), "__call__") as call: @@ -1654,7 +1654,7 @@ def test_update_index_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "index.name=index.name/value", + "index.name=name_value", ) in kw["metadata"] @@ -1668,7 +1668,7 @@ async def test_update_index_field_headers_async(): # a field header. Set these to a non-empty value. request = index_service.UpdateIndexRequest() - request.index.name = "index.name/value" + request.index.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_index), "__call__") as call: @@ -1686,7 +1686,7 @@ async def test_update_index_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "index.name=index.name/value", + "index.name=name_value", ) in kw["metadata"] @@ -1874,7 +1874,7 @@ def test_delete_index_field_headers(): # a field header. Set these to a non-empty value. request = index_service.DeleteIndexRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_index), "__call__") as call: @@ -1890,7 +1890,7 @@ def test_delete_index_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1904,7 +1904,7 @@ async def test_delete_index_field_headers_async(): # a field header. Set these to a non-empty value. request = index_service.DeleteIndexRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_index), "__call__") as call: @@ -1922,7 +1922,7 @@ async def test_delete_index_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_job_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_job_service.py index e66650d67d..c615e37c59 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_job_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_job_service.py @@ -779,7 +779,7 @@ def test_create_custom_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.CreateCustomJobRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -797,7 +797,7 @@ def test_create_custom_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -811,7 +811,7 @@ async def test_create_custom_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.CreateCustomJobRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -831,7 +831,7 @@ async def test_create_custom_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1037,7 +1037,7 @@ def test_get_custom_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.GetCustomJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_custom_job), "__call__") as call: @@ -1053,7 +1053,7 @@ def test_get_custom_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1067,7 +1067,7 @@ async def test_get_custom_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.GetCustomJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_custom_job), "__call__") as call: @@ -1085,7 +1085,7 @@ async def test_get_custom_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1269,7 +1269,7 @@ def test_list_custom_jobs_field_headers(): # a field header. Set these to a non-empty value. request = job_service.ListCustomJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_custom_jobs), "__call__") as call: @@ -1285,7 +1285,7 @@ def test_list_custom_jobs_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1299,7 +1299,7 @@ async def test_list_custom_jobs_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.ListCustomJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_custom_jobs), "__call__") as call: @@ -1317,7 +1317,7 @@ async def test_list_custom_jobs_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1448,7 +1448,7 @@ def test_list_custom_jobs_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, custom_job.CustomJob) for i in results) @@ -1689,7 +1689,7 @@ def test_delete_custom_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.DeleteCustomJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1707,7 +1707,7 @@ def test_delete_custom_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1721,7 +1721,7 @@ async def test_delete_custom_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.DeleteCustomJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1741,7 +1741,7 @@ async def test_delete_custom_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1927,7 +1927,7 @@ def test_cancel_custom_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.CancelCustomJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1945,7 +1945,7 @@ def test_cancel_custom_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1959,7 +1959,7 @@ async def test_cancel_custom_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.CancelCustomJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1977,7 +1977,7 @@ async def test_cancel_custom_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2202,7 +2202,7 @@ def test_create_data_labeling_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.CreateDataLabelingJobRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2220,7 +2220,7 @@ def test_create_data_labeling_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2234,7 +2234,7 @@ async def test_create_data_labeling_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.CreateDataLabelingJobRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2254,7 +2254,7 @@ async def test_create_data_labeling_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2490,7 +2490,7 @@ def test_get_data_labeling_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.GetDataLabelingJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2508,7 +2508,7 @@ def test_get_data_labeling_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2522,7 +2522,7 @@ async def test_get_data_labeling_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.GetDataLabelingJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2542,7 +2542,7 @@ async def test_get_data_labeling_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2737,7 +2737,7 @@ def test_list_data_labeling_jobs_field_headers(): # a field header. Set these to a non-empty value. request = job_service.ListDataLabelingJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2755,7 +2755,7 @@ def test_list_data_labeling_jobs_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2769,7 +2769,7 @@ async def test_list_data_labeling_jobs_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.ListDataLabelingJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2789,7 +2789,7 @@ async def test_list_data_labeling_jobs_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2926,7 +2926,7 @@ def test_list_data_labeling_jobs_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, data_labeling_job.DataLabelingJob) for i in results) @@ -3174,7 +3174,7 @@ def test_delete_data_labeling_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.DeleteDataLabelingJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3192,7 +3192,7 @@ def test_delete_data_labeling_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3206,7 +3206,7 @@ async def test_delete_data_labeling_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.DeleteDataLabelingJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3226,7 +3226,7 @@ async def test_delete_data_labeling_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3413,7 +3413,7 @@ def test_cancel_data_labeling_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.CancelDataLabelingJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3431,7 +3431,7 @@ def test_cancel_data_labeling_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3445,7 +3445,7 @@ async def test_cancel_data_labeling_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.CancelDataLabelingJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3463,7 +3463,7 @@ async def test_cancel_data_labeling_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3676,7 +3676,7 @@ def test_create_hyperparameter_tuning_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.CreateHyperparameterTuningJobRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3694,7 +3694,7 @@ def test_create_hyperparameter_tuning_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3708,7 +3708,7 @@ async def test_create_hyperparameter_tuning_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.CreateHyperparameterTuningJobRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3728,7 +3728,7 @@ async def test_create_hyperparameter_tuning_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3965,7 +3965,7 @@ def test_get_hyperparameter_tuning_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.GetHyperparameterTuningJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3983,7 +3983,7 @@ def test_get_hyperparameter_tuning_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3997,7 +3997,7 @@ async def test_get_hyperparameter_tuning_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.GetHyperparameterTuningJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4017,7 +4017,7 @@ async def test_get_hyperparameter_tuning_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4212,7 +4212,7 @@ def test_list_hyperparameter_tuning_jobs_field_headers(): # a field header. Set these to a non-empty value. request = job_service.ListHyperparameterTuningJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4230,7 +4230,7 @@ def test_list_hyperparameter_tuning_jobs_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4244,7 +4244,7 @@ async def test_list_hyperparameter_tuning_jobs_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.ListHyperparameterTuningJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4264,7 +4264,7 @@ async def test_list_hyperparameter_tuning_jobs_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4401,7 +4401,7 @@ def test_list_hyperparameter_tuning_jobs_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all( isinstance(i, hyperparameter_tuning_job.HyperparameterTuningJob) @@ -4655,7 +4655,7 @@ def test_delete_hyperparameter_tuning_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.DeleteHyperparameterTuningJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4673,7 +4673,7 @@ def test_delete_hyperparameter_tuning_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4687,7 +4687,7 @@ async def test_delete_hyperparameter_tuning_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.DeleteHyperparameterTuningJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4707,7 +4707,7 @@ async def test_delete_hyperparameter_tuning_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4894,7 +4894,7 @@ def test_cancel_hyperparameter_tuning_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.CancelHyperparameterTuningJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4912,7 +4912,7 @@ def test_cancel_hyperparameter_tuning_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4926,7 +4926,7 @@ async def test_cancel_hyperparameter_tuning_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.CancelHyperparameterTuningJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4944,7 +4944,7 @@ async def test_cancel_hyperparameter_tuning_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5161,7 +5161,7 @@ def test_create_batch_prediction_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.CreateBatchPredictionJobRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5179,7 +5179,7 @@ def test_create_batch_prediction_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5193,7 +5193,7 @@ async def test_create_batch_prediction_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.CreateBatchPredictionJobRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5213,7 +5213,7 @@ async def test_create_batch_prediction_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5450,7 +5450,7 @@ def test_get_batch_prediction_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.GetBatchPredictionJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5468,7 +5468,7 @@ def test_get_batch_prediction_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5482,7 +5482,7 @@ async def test_get_batch_prediction_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.GetBatchPredictionJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5502,7 +5502,7 @@ async def test_get_batch_prediction_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5697,7 +5697,7 @@ def test_list_batch_prediction_jobs_field_headers(): # a field header. Set these to a non-empty value. request = job_service.ListBatchPredictionJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5715,7 +5715,7 @@ def test_list_batch_prediction_jobs_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5729,7 +5729,7 @@ async def test_list_batch_prediction_jobs_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.ListBatchPredictionJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5749,7 +5749,7 @@ async def test_list_batch_prediction_jobs_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5886,7 +5886,7 @@ def test_list_batch_prediction_jobs_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all( isinstance(i, batch_prediction_job.BatchPredictionJob) for i in results @@ -6138,7 +6138,7 @@ def test_delete_batch_prediction_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.DeleteBatchPredictionJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6156,7 +6156,7 @@ def test_delete_batch_prediction_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -6170,7 +6170,7 @@ async def test_delete_batch_prediction_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.DeleteBatchPredictionJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6190,7 +6190,7 @@ async def test_delete_batch_prediction_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -6377,7 +6377,7 @@ def test_cancel_batch_prediction_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.CancelBatchPredictionJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6395,7 +6395,7 @@ def test_cancel_batch_prediction_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -6409,7 +6409,7 @@ async def test_cancel_batch_prediction_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.CancelBatchPredictionJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6427,7 +6427,7 @@ async def test_cancel_batch_prediction_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -6658,7 +6658,7 @@ def test_create_model_deployment_monitoring_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.CreateModelDeploymentMonitoringJobRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6678,7 +6678,7 @@ def test_create_model_deployment_monitoring_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -6692,7 +6692,7 @@ async def test_create_model_deployment_monitoring_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.CreateModelDeploymentMonitoringJobRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6712,7 +6712,7 @@ async def test_create_model_deployment_monitoring_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -6957,7 +6957,7 @@ def test_search_model_deployment_monitoring_stats_anomalies_field_headers(): # a field header. Set these to a non-empty value. request = job_service.SearchModelDeploymentMonitoringStatsAnomaliesRequest() - request.model_deployment_monitoring_job = "model_deployment_monitoring_job/value" + request.model_deployment_monitoring_job = "model_deployment_monitoring_job_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6978,7 +6978,7 @@ def test_search_model_deployment_monitoring_stats_anomalies_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "model_deployment_monitoring_job=model_deployment_monitoring_job/value", + "model_deployment_monitoring_job=model_deployment_monitoring_job_value", ) in kw["metadata"] @@ -6992,7 +6992,7 @@ async def test_search_model_deployment_monitoring_stats_anomalies_field_headers_ # a field header. Set these to a non-empty value. request = job_service.SearchModelDeploymentMonitoringStatsAnomaliesRequest() - request.model_deployment_monitoring_job = "model_deployment_monitoring_job/value" + request.model_deployment_monitoring_job = "model_deployment_monitoring_job_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7013,7 +7013,7 @@ async def test_search_model_deployment_monitoring_stats_anomalies_field_headers_ _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "model_deployment_monitoring_job=model_deployment_monitoring_job/value", + "model_deployment_monitoring_job=model_deployment_monitoring_job_value", ) in kw["metadata"] @@ -7171,7 +7171,7 @@ def test_search_model_deployment_monitoring_stats_anomalies_pager( assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all( isinstance( @@ -7478,7 +7478,7 @@ def test_get_model_deployment_monitoring_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.GetModelDeploymentMonitoringJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7498,7 +7498,7 @@ def test_get_model_deployment_monitoring_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -7512,7 +7512,7 @@ async def test_get_model_deployment_monitoring_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.GetModelDeploymentMonitoringJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7532,7 +7532,7 @@ async def test_get_model_deployment_monitoring_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -7731,7 +7731,7 @@ def test_list_model_deployment_monitoring_jobs_field_headers(): # a field header. Set these to a non-empty value. request = job_service.ListModelDeploymentMonitoringJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7749,7 +7749,7 @@ def test_list_model_deployment_monitoring_jobs_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -7763,7 +7763,7 @@ async def test_list_model_deployment_monitoring_jobs_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.ListModelDeploymentMonitoringJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7783,7 +7783,7 @@ async def test_list_model_deployment_monitoring_jobs_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -7920,7 +7920,7 @@ def test_list_model_deployment_monitoring_jobs_pager(transport_name: str = "grpc assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all( isinstance(i, model_deployment_monitoring_job.ModelDeploymentMonitoringJob) @@ -8174,9 +8174,7 @@ def test_update_model_deployment_monitoring_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.UpdateModelDeploymentMonitoringJobRequest() - request.model_deployment_monitoring_job.name = ( - "model_deployment_monitoring_job.name/value" - ) + request.model_deployment_monitoring_job.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8194,7 +8192,7 @@ def test_update_model_deployment_monitoring_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "model_deployment_monitoring_job.name=model_deployment_monitoring_job.name/value", + "model_deployment_monitoring_job.name=name_value", ) in kw["metadata"] @@ -8208,9 +8206,7 @@ async def test_update_model_deployment_monitoring_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.UpdateModelDeploymentMonitoringJobRequest() - request.model_deployment_monitoring_job.name = ( - "model_deployment_monitoring_job.name/value" - ) + request.model_deployment_monitoring_job.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8230,7 +8226,7 @@ async def test_update_model_deployment_monitoring_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "model_deployment_monitoring_job.name=model_deployment_monitoring_job.name/value", + "model_deployment_monitoring_job.name=name_value", ) in kw["metadata"] @@ -8441,7 +8437,7 @@ def test_delete_model_deployment_monitoring_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.DeleteModelDeploymentMonitoringJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8459,7 +8455,7 @@ def test_delete_model_deployment_monitoring_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -8473,7 +8469,7 @@ async def test_delete_model_deployment_monitoring_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.DeleteModelDeploymentMonitoringJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8493,7 +8489,7 @@ async def test_delete_model_deployment_monitoring_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -8680,7 +8676,7 @@ def test_pause_model_deployment_monitoring_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.PauseModelDeploymentMonitoringJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8698,7 +8694,7 @@ def test_pause_model_deployment_monitoring_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -8712,7 +8708,7 @@ async def test_pause_model_deployment_monitoring_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.PauseModelDeploymentMonitoringJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8730,7 +8726,7 @@ async def test_pause_model_deployment_monitoring_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -8915,7 +8911,7 @@ def test_resume_model_deployment_monitoring_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.ResumeModelDeploymentMonitoringJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8933,7 +8929,7 @@ def test_resume_model_deployment_monitoring_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -8947,7 +8943,7 @@ async def test_resume_model_deployment_monitoring_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.ResumeModelDeploymentMonitoringJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8965,7 +8961,7 @@ async def test_resume_model_deployment_monitoring_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_metadata_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_metadata_service.py index bd09e856f9..3a97bca5c0 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_metadata_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_metadata_service.py @@ -784,7 +784,7 @@ def test_create_metadata_store_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.CreateMetadataStoreRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -802,7 +802,7 @@ def test_create_metadata_store_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -816,7 +816,7 @@ async def test_create_metadata_store_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.CreateMetadataStoreRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -836,7 +836,7 @@ async def test_create_metadata_store_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1055,7 +1055,7 @@ def test_get_metadata_store_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.GetMetadataStoreRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1073,7 +1073,7 @@ def test_get_metadata_store_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1087,7 +1087,7 @@ async def test_get_metadata_store_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.GetMetadataStoreRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1107,7 +1107,7 @@ async def test_get_metadata_store_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1302,7 +1302,7 @@ def test_list_metadata_stores_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.ListMetadataStoresRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1320,7 +1320,7 @@ def test_list_metadata_stores_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1334,7 +1334,7 @@ async def test_list_metadata_stores_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.ListMetadataStoresRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1354,7 +1354,7 @@ async def test_list_metadata_stores_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1491,7 +1491,7 @@ def test_list_metadata_stores_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, metadata_store.MetadataStore) for i in results) @@ -1739,7 +1739,7 @@ def test_delete_metadata_store_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.DeleteMetadataStoreRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1757,7 +1757,7 @@ def test_delete_metadata_store_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1771,7 +1771,7 @@ async def test_delete_metadata_store_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.DeleteMetadataStoreRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1791,7 +1791,7 @@ async def test_delete_metadata_store_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2007,7 +2007,7 @@ def test_create_artifact_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.CreateArtifactRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_artifact), "__call__") as call: @@ -2023,7 +2023,7 @@ def test_create_artifact_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2037,7 +2037,7 @@ async def test_create_artifact_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.CreateArtifactRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_artifact), "__call__") as call: @@ -2055,7 +2055,7 @@ async def test_create_artifact_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2287,7 +2287,7 @@ def test_get_artifact_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.GetArtifactRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_artifact), "__call__") as call: @@ -2303,7 +2303,7 @@ def test_get_artifact_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2317,7 +2317,7 @@ async def test_get_artifact_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.GetArtifactRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_artifact), "__call__") as call: @@ -2333,7 +2333,7 @@ async def test_get_artifact_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2515,7 +2515,7 @@ def test_list_artifacts_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.ListArtifactsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_artifacts), "__call__") as call: @@ -2531,7 +2531,7 @@ def test_list_artifacts_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2545,7 +2545,7 @@ async def test_list_artifacts_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.ListArtifactsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_artifacts), "__call__") as call: @@ -2563,7 +2563,7 @@ async def test_list_artifacts_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2694,7 +2694,7 @@ def test_list_artifacts_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, artifact.Artifact) for i in results) @@ -2963,7 +2963,7 @@ def test_update_artifact_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.UpdateArtifactRequest() - request.artifact.name = "artifact.name/value" + request.artifact.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_artifact), "__call__") as call: @@ -2979,7 +2979,7 @@ def test_update_artifact_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "artifact.name=artifact.name/value", + "artifact.name=name_value", ) in kw["metadata"] @@ -2993,7 +2993,7 @@ async def test_update_artifact_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.UpdateArtifactRequest() - request.artifact.name = "artifact.name/value" + request.artifact.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_artifact), "__call__") as call: @@ -3011,7 +3011,7 @@ async def test_update_artifact_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "artifact.name=artifact.name/value", + "artifact.name=name_value", ) in kw["metadata"] @@ -3199,7 +3199,7 @@ def test_delete_artifact_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.DeleteArtifactRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_artifact), "__call__") as call: @@ -3215,7 +3215,7 @@ def test_delete_artifact_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3229,7 +3229,7 @@ async def test_delete_artifact_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.DeleteArtifactRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_artifact), "__call__") as call: @@ -3247,7 +3247,7 @@ async def test_delete_artifact_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3425,7 +3425,7 @@ def test_purge_artifacts_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.PurgeArtifactsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.purge_artifacts), "__call__") as call: @@ -3441,7 +3441,7 @@ def test_purge_artifacts_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3455,7 +3455,7 @@ async def test_purge_artifacts_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.PurgeArtifactsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.purge_artifacts), "__call__") as call: @@ -3473,7 +3473,7 @@ async def test_purge_artifacts_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3681,7 +3681,7 @@ def test_create_context_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.CreateContextRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_context), "__call__") as call: @@ -3697,7 +3697,7 @@ def test_create_context_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3711,7 +3711,7 @@ async def test_create_context_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.CreateContextRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_context), "__call__") as call: @@ -3727,7 +3727,7 @@ async def test_create_context_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3953,7 +3953,7 @@ def test_get_context_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.GetContextRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_context), "__call__") as call: @@ -3969,7 +3969,7 @@ def test_get_context_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3983,7 +3983,7 @@ async def test_get_context_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.GetContextRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_context), "__call__") as call: @@ -3999,7 +3999,7 @@ async def test_get_context_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4181,7 +4181,7 @@ def test_list_contexts_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.ListContextsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_contexts), "__call__") as call: @@ -4197,7 +4197,7 @@ def test_list_contexts_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4211,7 +4211,7 @@ async def test_list_contexts_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.ListContextsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_contexts), "__call__") as call: @@ -4229,7 +4229,7 @@ async def test_list_contexts_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4360,7 +4360,7 @@ def test_list_contexts_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, context.Context) for i in results) @@ -4625,7 +4625,7 @@ def test_update_context_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.UpdateContextRequest() - request.context.name = "context.name/value" + request.context.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_context), "__call__") as call: @@ -4641,7 +4641,7 @@ def test_update_context_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "context.name=context.name/value", + "context.name=name_value", ) in kw["metadata"] @@ -4655,7 +4655,7 @@ async def test_update_context_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.UpdateContextRequest() - request.context.name = "context.name/value" + request.context.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_context), "__call__") as call: @@ -4671,7 +4671,7 @@ async def test_update_context_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "context.name=context.name/value", + "context.name=name_value", ) in kw["metadata"] @@ -4857,7 +4857,7 @@ def test_delete_context_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.DeleteContextRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_context), "__call__") as call: @@ -4873,7 +4873,7 @@ def test_delete_context_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4887,7 +4887,7 @@ async def test_delete_context_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.DeleteContextRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_context), "__call__") as call: @@ -4905,7 +4905,7 @@ async def test_delete_context_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5083,7 +5083,7 @@ def test_purge_contexts_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.PurgeContextsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.purge_contexts), "__call__") as call: @@ -5099,7 +5099,7 @@ def test_purge_contexts_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5113,7 +5113,7 @@ async def test_purge_contexts_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.PurgeContextsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.purge_contexts), "__call__") as call: @@ -5131,7 +5131,7 @@ async def test_purge_contexts_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5320,7 +5320,7 @@ def test_add_context_artifacts_and_executions_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.AddContextArtifactsAndExecutionsRequest() - request.context = "context/value" + request.context = "context_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5338,7 +5338,7 @@ def test_add_context_artifacts_and_executions_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "context=context/value", + "context=context_value", ) in kw["metadata"] @@ -5352,7 +5352,7 @@ async def test_add_context_artifacts_and_executions_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.AddContextArtifactsAndExecutionsRequest() - request.context = "context/value" + request.context = "context_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5372,7 +5372,7 @@ async def test_add_context_artifacts_and_executions_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "context=context/value", + "context=context_value", ) in kw["metadata"] @@ -5581,7 +5581,7 @@ def test_add_context_children_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.AddContextChildrenRequest() - request.context = "context/value" + request.context = "context_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5599,7 +5599,7 @@ def test_add_context_children_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "context=context/value", + "context=context_value", ) in kw["metadata"] @@ -5613,7 +5613,7 @@ async def test_add_context_children_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.AddContextChildrenRequest() - request.context = "context/value" + request.context = "context_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5633,7 +5633,7 @@ async def test_add_context_children_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "context=context/value", + "context=context_value", ) in kw["metadata"] @@ -5832,7 +5832,7 @@ def test_query_context_lineage_subgraph_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.QueryContextLineageSubgraphRequest() - request.context = "context/value" + request.context = "context_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5850,7 +5850,7 @@ def test_query_context_lineage_subgraph_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "context=context/value", + "context=context_value", ) in kw["metadata"] @@ -5864,7 +5864,7 @@ async def test_query_context_lineage_subgraph_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.QueryContextLineageSubgraphRequest() - request.context = "context/value" + request.context = "context_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5884,7 +5884,7 @@ async def test_query_context_lineage_subgraph_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "context=context/value", + "context=context_value", ) in kw["metadata"] @@ -6097,7 +6097,7 @@ def test_create_execution_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.CreateExecutionRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_execution), "__call__") as call: @@ -6113,7 +6113,7 @@ def test_create_execution_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -6127,7 +6127,7 @@ async def test_create_execution_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.CreateExecutionRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_execution), "__call__") as call: @@ -6145,7 +6145,7 @@ async def test_create_execution_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -6373,7 +6373,7 @@ def test_get_execution_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.GetExecutionRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_execution), "__call__") as call: @@ -6389,7 +6389,7 @@ def test_get_execution_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -6403,7 +6403,7 @@ async def test_get_execution_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.GetExecutionRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_execution), "__call__") as call: @@ -6419,7 +6419,7 @@ async def test_get_execution_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -6601,7 +6601,7 @@ def test_list_executions_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.ListExecutionsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_executions), "__call__") as call: @@ -6617,7 +6617,7 @@ def test_list_executions_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -6631,7 +6631,7 @@ async def test_list_executions_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.ListExecutionsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_executions), "__call__") as call: @@ -6649,7 +6649,7 @@ async def test_list_executions_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -6780,7 +6780,7 @@ def test_list_executions_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, execution.Execution) for i in results) @@ -7046,7 +7046,7 @@ def test_update_execution_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.UpdateExecutionRequest() - request.execution.name = "execution.name/value" + request.execution.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_execution), "__call__") as call: @@ -7062,7 +7062,7 @@ def test_update_execution_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "execution.name=execution.name/value", + "execution.name=name_value", ) in kw["metadata"] @@ -7076,7 +7076,7 @@ async def test_update_execution_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.UpdateExecutionRequest() - request.execution.name = "execution.name/value" + request.execution.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_execution), "__call__") as call: @@ -7094,7 +7094,7 @@ async def test_update_execution_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "execution.name=execution.name/value", + "execution.name=name_value", ) in kw["metadata"] @@ -7283,7 +7283,7 @@ def test_delete_execution_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.DeleteExecutionRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_execution), "__call__") as call: @@ -7299,7 +7299,7 @@ def test_delete_execution_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -7313,7 +7313,7 @@ async def test_delete_execution_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.DeleteExecutionRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_execution), "__call__") as call: @@ -7331,7 +7331,7 @@ async def test_delete_execution_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -7510,7 +7510,7 @@ def test_purge_executions_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.PurgeExecutionsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.purge_executions), "__call__") as call: @@ -7526,7 +7526,7 @@ def test_purge_executions_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -7540,7 +7540,7 @@ async def test_purge_executions_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.PurgeExecutionsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.purge_executions), "__call__") as call: @@ -7558,7 +7558,7 @@ async def test_purge_executions_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -7743,7 +7743,7 @@ def test_add_execution_events_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.AddExecutionEventsRequest() - request.execution = "execution/value" + request.execution = "execution_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7761,7 +7761,7 @@ def test_add_execution_events_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "execution=execution/value", + "execution=execution_value", ) in kw["metadata"] @@ -7775,7 +7775,7 @@ async def test_add_execution_events_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.AddExecutionEventsRequest() - request.execution = "execution/value" + request.execution = "execution_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7795,7 +7795,7 @@ async def test_add_execution_events_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "execution=execution/value", + "execution=execution_value", ) in kw["metadata"] @@ -7994,7 +7994,7 @@ def test_query_execution_inputs_and_outputs_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.QueryExecutionInputsAndOutputsRequest() - request.execution = "execution/value" + request.execution = "execution_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8012,7 +8012,7 @@ def test_query_execution_inputs_and_outputs_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "execution=execution/value", + "execution=execution_value", ) in kw["metadata"] @@ -8026,7 +8026,7 @@ async def test_query_execution_inputs_and_outputs_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.QueryExecutionInputsAndOutputsRequest() - request.execution = "execution/value" + request.execution = "execution_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8046,7 +8046,7 @@ async def test_query_execution_inputs_and_outputs_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "execution=execution/value", + "execution=execution_value", ) in kw["metadata"] @@ -8263,7 +8263,7 @@ def test_create_metadata_schema_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.CreateMetadataSchemaRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8281,7 +8281,7 @@ def test_create_metadata_schema_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -8295,7 +8295,7 @@ async def test_create_metadata_schema_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.CreateMetadataSchemaRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8315,7 +8315,7 @@ async def test_create_metadata_schema_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -8552,7 +8552,7 @@ def test_get_metadata_schema_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.GetMetadataSchemaRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8570,7 +8570,7 @@ def test_get_metadata_schema_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -8584,7 +8584,7 @@ async def test_get_metadata_schema_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.GetMetadataSchemaRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8604,7 +8604,7 @@ async def test_get_metadata_schema_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -8799,7 +8799,7 @@ def test_list_metadata_schemas_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.ListMetadataSchemasRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8817,7 +8817,7 @@ def test_list_metadata_schemas_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -8831,7 +8831,7 @@ async def test_list_metadata_schemas_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.ListMetadataSchemasRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8851,7 +8851,7 @@ async def test_list_metadata_schemas_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -8988,7 +8988,7 @@ def test_list_metadata_schemas_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, metadata_schema.MetadataSchema) for i in results) @@ -9236,7 +9236,7 @@ def test_query_artifact_lineage_subgraph_field_headers(): # a field header. Set these to a non-empty value. request = metadata_service.QueryArtifactLineageSubgraphRequest() - request.artifact = "artifact/value" + request.artifact = "artifact_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -9254,7 +9254,7 @@ def test_query_artifact_lineage_subgraph_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "artifact=artifact/value", + "artifact=artifact_value", ) in kw["metadata"] @@ -9268,7 +9268,7 @@ async def test_query_artifact_lineage_subgraph_field_headers_async(): # a field header. Set these to a non-empty value. request = metadata_service.QueryArtifactLineageSubgraphRequest() - request.artifact = "artifact/value" + request.artifact = "artifact_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -9288,7 +9288,7 @@ async def test_query_artifact_lineage_subgraph_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "artifact=artifact/value", + "artifact=artifact_value", ) in kw["metadata"] diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_migration_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_migration_service.py index 7f195de7f3..49fd9ca313 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_migration_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_migration_service.py @@ -775,7 +775,7 @@ def test_search_migratable_resources_field_headers(): # a field header. Set these to a non-empty value. request = migration_service.SearchMigratableResourcesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -793,7 +793,7 @@ def test_search_migratable_resources_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -807,7 +807,7 @@ async def test_search_migratable_resources_field_headers_async(): # a field header. Set these to a non-empty value. request = migration_service.SearchMigratableResourcesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -827,7 +827,7 @@ async def test_search_migratable_resources_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -964,7 +964,7 @@ def test_search_migratable_resources_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all( isinstance(i, migratable_resource.MigratableResource) for i in results @@ -1216,7 +1216,7 @@ def test_batch_migrate_resources_field_headers(): # a field header. Set these to a non-empty value. request = migration_service.BatchMigrateResourcesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1234,7 +1234,7 @@ def test_batch_migrate_resources_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1248,7 +1248,7 @@ async def test_batch_migrate_resources_field_headers_async(): # a field header. Set these to a non-empty value. request = migration_service.BatchMigrateResourcesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1268,7 +1268,7 @@ async def test_batch_migrate_resources_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1935,22 +1935,19 @@ def test_parse_annotated_dataset_path(): def test_dataset_path(): project = "cuttlefish" - location = "mussel" - dataset = "winkle" - expected = "projects/{project}/locations/{location}/datasets/{dataset}".format( + dataset = "mussel" + expected = "projects/{project}/datasets/{dataset}".format( project=project, - location=location, dataset=dataset, ) - actual = MigrationServiceClient.dataset_path(project, location, dataset) + actual = MigrationServiceClient.dataset_path(project, dataset) assert expected == actual def test_parse_dataset_path(): expected = { - "project": "nautilus", - "location": "scallop", - "dataset": "abalone", + "project": "winkle", + "dataset": "nautilus", } path = MigrationServiceClient.dataset_path(**expected) @@ -1960,19 +1957,22 @@ def test_parse_dataset_path(): def test_dataset_path(): - project = "squid" - dataset = "clam" - expected = "projects/{project}/datasets/{dataset}".format( + project = "scallop" + location = "abalone" + dataset = "squid" + expected = "projects/{project}/locations/{location}/datasets/{dataset}".format( project=project, + location=location, dataset=dataset, ) - actual = MigrationServiceClient.dataset_path(project, dataset) + actual = MigrationServiceClient.dataset_path(project, location, dataset) assert expected == actual def test_parse_dataset_path(): expected = { - "project": "whelk", + "project": "clam", + "location": "whelk", "dataset": "octopus", } path = MigrationServiceClient.dataset_path(**expected) diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_model_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_model_service.py index 8a0940ae07..0ca4ae225d 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_model_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_model_service.py @@ -748,7 +748,7 @@ def test_upload_model_field_headers(): # a field header. Set these to a non-empty value. request = model_service.UploadModelRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.upload_model), "__call__") as call: @@ -764,7 +764,7 @@ def test_upload_model_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -778,7 +778,7 @@ async def test_upload_model_field_headers_async(): # a field header. Set these to a non-empty value. request = model_service.UploadModelRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.upload_model), "__call__") as call: @@ -796,7 +796,7 @@ async def test_upload_model_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1058,7 +1058,7 @@ def test_get_model_field_headers(): # a field header. Set these to a non-empty value. request = model_service.GetModelRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_model), "__call__") as call: @@ -1074,7 +1074,7 @@ def test_get_model_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1088,7 +1088,7 @@ async def test_get_model_field_headers_async(): # a field header. Set these to a non-empty value. request = model_service.GetModelRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_model), "__call__") as call: @@ -1104,7 +1104,7 @@ async def test_get_model_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1286,7 +1286,7 @@ def test_list_models_field_headers(): # a field header. Set these to a non-empty value. request = model_service.ListModelsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_models), "__call__") as call: @@ -1302,7 +1302,7 @@ def test_list_models_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1316,7 +1316,7 @@ async def test_list_models_field_headers_async(): # a field header. Set these to a non-empty value. request = model_service.ListModelsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_models), "__call__") as call: @@ -1334,7 +1334,7 @@ async def test_list_models_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1465,7 +1465,7 @@ def test_list_models_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, model.Model) for i in results) @@ -1712,7 +1712,7 @@ def test_list_model_versions_field_headers(): # a field header. Set these to a non-empty value. request = model_service.ListModelVersionsRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1730,7 +1730,7 @@ def test_list_model_versions_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1744,7 +1744,7 @@ async def test_list_model_versions_field_headers_async(): # a field header. Set these to a non-empty value. request = model_service.ListModelVersionsRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1764,7 +1764,7 @@ async def test_list_model_versions_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1901,7 +1901,7 @@ def test_list_model_versions_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, model.Model) for i in results) @@ -2216,7 +2216,7 @@ def test_update_model_field_headers(): # a field header. Set these to a non-empty value. request = model_service.UpdateModelRequest() - request.model.name = "model.name/value" + request.model.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_model), "__call__") as call: @@ -2232,7 +2232,7 @@ def test_update_model_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "model.name=model.name/value", + "model.name=name_value", ) in kw["metadata"] @@ -2246,7 +2246,7 @@ async def test_update_model_field_headers_async(): # a field header. Set these to a non-empty value. request = model_service.UpdateModelRequest() - request.model.name = "model.name/value" + request.model.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_model), "__call__") as call: @@ -2262,7 +2262,7 @@ async def test_update_model_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "model.name=model.name/value", + "model.name=name_value", ) in kw["metadata"] @@ -2448,7 +2448,7 @@ def test_delete_model_field_headers(): # a field header. Set these to a non-empty value. request = model_service.DeleteModelRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_model), "__call__") as call: @@ -2464,7 +2464,7 @@ def test_delete_model_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2478,7 +2478,7 @@ async def test_delete_model_field_headers_async(): # a field header. Set these to a non-empty value. request = model_service.DeleteModelRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_model), "__call__") as call: @@ -2496,7 +2496,7 @@ async def test_delete_model_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2681,7 +2681,7 @@ def test_delete_model_version_field_headers(): # a field header. Set these to a non-empty value. request = model_service.DeleteModelVersionRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2699,7 +2699,7 @@ def test_delete_model_version_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2713,7 +2713,7 @@ async def test_delete_model_version_field_headers_async(): # a field header. Set these to a non-empty value. request = model_service.DeleteModelVersionRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2733,7 +2733,7 @@ async def test_delete_model_version_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2996,7 +2996,7 @@ def test_merge_version_aliases_field_headers(): # a field header. Set these to a non-empty value. request = model_service.MergeVersionAliasesRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3014,7 +3014,7 @@ def test_merge_version_aliases_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3028,7 +3028,7 @@ async def test_merge_version_aliases_field_headers_async(): # a field header. Set these to a non-empty value. request = model_service.MergeVersionAliasesRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3046,7 +3046,7 @@ async def test_merge_version_aliases_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3236,7 +3236,7 @@ def test_export_model_field_headers(): # a field header. Set these to a non-empty value. request = model_service.ExportModelRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.export_model), "__call__") as call: @@ -3252,7 +3252,7 @@ def test_export_model_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3266,7 +3266,7 @@ async def test_export_model_field_headers_async(): # a field header. Set these to a non-empty value. request = model_service.ExportModelRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.export_model), "__call__") as call: @@ -3284,7 +3284,7 @@ async def test_export_model_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3505,7 +3505,7 @@ def test_import_model_evaluation_field_headers(): # a field header. Set these to a non-empty value. request = model_service.ImportModelEvaluationRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3523,7 +3523,7 @@ def test_import_model_evaluation_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3537,7 +3537,7 @@ async def test_import_model_evaluation_field_headers_async(): # a field header. Set these to a non-empty value. request = model_service.ImportModelEvaluationRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3557,7 +3557,7 @@ async def test_import_model_evaluation_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3770,7 +3770,7 @@ def test_get_model_evaluation_field_headers(): # a field header. Set these to a non-empty value. request = model_service.GetModelEvaluationRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3788,7 +3788,7 @@ def test_get_model_evaluation_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3802,7 +3802,7 @@ async def test_get_model_evaluation_field_headers_async(): # a field header. Set these to a non-empty value. request = model_service.GetModelEvaluationRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3822,7 +3822,7 @@ async def test_get_model_evaluation_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4017,7 +4017,7 @@ def test_list_model_evaluations_field_headers(): # a field header. Set these to a non-empty value. request = model_service.ListModelEvaluationsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4035,7 +4035,7 @@ def test_list_model_evaluations_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4049,7 +4049,7 @@ async def test_list_model_evaluations_field_headers_async(): # a field header. Set these to a non-empty value. request = model_service.ListModelEvaluationsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4069,7 +4069,7 @@ async def test_list_model_evaluations_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4206,7 +4206,7 @@ def test_list_model_evaluations_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, model_evaluation.ModelEvaluation) for i in results) @@ -4464,7 +4464,7 @@ def test_get_model_evaluation_slice_field_headers(): # a field header. Set these to a non-empty value. request = model_service.GetModelEvaluationSliceRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4482,7 +4482,7 @@ def test_get_model_evaluation_slice_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4496,7 +4496,7 @@ async def test_get_model_evaluation_slice_field_headers_async(): # a field header. Set these to a non-empty value. request = model_service.GetModelEvaluationSliceRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4516,7 +4516,7 @@ async def test_get_model_evaluation_slice_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4711,7 +4711,7 @@ def test_list_model_evaluation_slices_field_headers(): # a field header. Set these to a non-empty value. request = model_service.ListModelEvaluationSlicesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4729,7 +4729,7 @@ def test_list_model_evaluation_slices_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4743,7 +4743,7 @@ async def test_list_model_evaluation_slices_field_headers_async(): # a field header. Set these to a non-empty value. request = model_service.ListModelEvaluationSlicesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4763,7 +4763,7 @@ async def test_list_model_evaluation_slices_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4900,7 +4900,7 @@ def test_list_model_evaluation_slices_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all( isinstance(i, model_evaluation_slice.ModelEvaluationSlice) for i in results diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_pipeline_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_pipeline_service.py index 4dcc573c07..19d37fae67 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_pipeline_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_pipeline_service.py @@ -817,7 +817,7 @@ def test_create_training_pipeline_field_headers(): # a field header. Set these to a non-empty value. request = pipeline_service.CreateTrainingPipelineRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -835,7 +835,7 @@ def test_create_training_pipeline_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -849,7 +849,7 @@ async def test_create_training_pipeline_field_headers_async(): # a field header. Set these to a non-empty value. request = pipeline_service.CreateTrainingPipelineRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -869,7 +869,7 @@ async def test_create_training_pipeline_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1094,7 +1094,7 @@ def test_get_training_pipeline_field_headers(): # a field header. Set these to a non-empty value. request = pipeline_service.GetTrainingPipelineRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1112,7 +1112,7 @@ def test_get_training_pipeline_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1126,7 +1126,7 @@ async def test_get_training_pipeline_field_headers_async(): # a field header. Set these to a non-empty value. request = pipeline_service.GetTrainingPipelineRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1146,7 +1146,7 @@ async def test_get_training_pipeline_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1341,7 +1341,7 @@ def test_list_training_pipelines_field_headers(): # a field header. Set these to a non-empty value. request = pipeline_service.ListTrainingPipelinesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1359,7 +1359,7 @@ def test_list_training_pipelines_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1373,7 +1373,7 @@ async def test_list_training_pipelines_field_headers_async(): # a field header. Set these to a non-empty value. request = pipeline_service.ListTrainingPipelinesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1393,7 +1393,7 @@ async def test_list_training_pipelines_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1530,7 +1530,7 @@ def test_list_training_pipelines_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, training_pipeline.TrainingPipeline) for i in results) @@ -1778,7 +1778,7 @@ def test_delete_training_pipeline_field_headers(): # a field header. Set these to a non-empty value. request = pipeline_service.DeleteTrainingPipelineRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1796,7 +1796,7 @@ def test_delete_training_pipeline_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1810,7 +1810,7 @@ async def test_delete_training_pipeline_field_headers_async(): # a field header. Set these to a non-empty value. request = pipeline_service.DeleteTrainingPipelineRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1830,7 +1830,7 @@ async def test_delete_training_pipeline_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2017,7 +2017,7 @@ def test_cancel_training_pipeline_field_headers(): # a field header. Set these to a non-empty value. request = pipeline_service.CancelTrainingPipelineRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2035,7 +2035,7 @@ def test_cancel_training_pipeline_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2049,7 +2049,7 @@ async def test_cancel_training_pipeline_field_headers_async(): # a field header. Set these to a non-empty value. request = pipeline_service.CancelTrainingPipelineRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2067,7 +2067,7 @@ async def test_cancel_training_pipeline_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2183,6 +2183,7 @@ def test_create_pipeline_job(request_type, transport: str = "grpc"): state=pipeline_state.PipelineState.PIPELINE_STATE_QUEUED, service_account="service_account_value", network="network_value", + template_uri="template_uri_value", ) response = client.create_pipeline_job(request) @@ -2198,6 +2199,7 @@ def test_create_pipeline_job(request_type, transport: str = "grpc"): assert response.state == pipeline_state.PipelineState.PIPELINE_STATE_QUEUED assert response.service_account == "service_account_value" assert response.network == "network_value" + assert response.template_uri == "template_uri_value" def test_create_pipeline_job_empty_call(): @@ -2244,6 +2246,7 @@ async def test_create_pipeline_job_async( state=pipeline_state.PipelineState.PIPELINE_STATE_QUEUED, service_account="service_account_value", network="network_value", + template_uri="template_uri_value", ) ) response = await client.create_pipeline_job(request) @@ -2260,6 +2263,7 @@ async def test_create_pipeline_job_async( assert response.state == pipeline_state.PipelineState.PIPELINE_STATE_QUEUED assert response.service_account == "service_account_value" assert response.network == "network_value" + assert response.template_uri == "template_uri_value" @pytest.mark.asyncio @@ -2276,7 +2280,7 @@ def test_create_pipeline_job_field_headers(): # a field header. Set these to a non-empty value. request = pipeline_service.CreatePipelineJobRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2294,7 +2298,7 @@ def test_create_pipeline_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2308,7 +2312,7 @@ async def test_create_pipeline_job_field_headers_async(): # a field header. Set these to a non-empty value. request = pipeline_service.CreatePipelineJobRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2328,7 +2332,7 @@ async def test_create_pipeline_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2464,6 +2468,7 @@ def test_get_pipeline_job(request_type, transport: str = "grpc"): state=pipeline_state.PipelineState.PIPELINE_STATE_QUEUED, service_account="service_account_value", network="network_value", + template_uri="template_uri_value", ) response = client.get_pipeline_job(request) @@ -2479,6 +2484,7 @@ def test_get_pipeline_job(request_type, transport: str = "grpc"): assert response.state == pipeline_state.PipelineState.PIPELINE_STATE_QUEUED assert response.service_account == "service_account_value" assert response.network == "network_value" + assert response.template_uri == "template_uri_value" def test_get_pipeline_job_empty_call(): @@ -2520,6 +2526,7 @@ async def test_get_pipeline_job_async( state=pipeline_state.PipelineState.PIPELINE_STATE_QUEUED, service_account="service_account_value", network="network_value", + template_uri="template_uri_value", ) ) response = await client.get_pipeline_job(request) @@ -2536,6 +2543,7 @@ async def test_get_pipeline_job_async( assert response.state == pipeline_state.PipelineState.PIPELINE_STATE_QUEUED assert response.service_account == "service_account_value" assert response.network == "network_value" + assert response.template_uri == "template_uri_value" @pytest.mark.asyncio @@ -2552,7 +2560,7 @@ def test_get_pipeline_job_field_headers(): # a field header. Set these to a non-empty value. request = pipeline_service.GetPipelineJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_pipeline_job), "__call__") as call: @@ -2568,7 +2576,7 @@ def test_get_pipeline_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2582,7 +2590,7 @@ async def test_get_pipeline_job_field_headers_async(): # a field header. Set these to a non-empty value. request = pipeline_service.GetPipelineJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_pipeline_job), "__call__") as call: @@ -2600,7 +2608,7 @@ async def test_get_pipeline_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2791,7 +2799,7 @@ def test_list_pipeline_jobs_field_headers(): # a field header. Set these to a non-empty value. request = pipeline_service.ListPipelineJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2809,7 +2817,7 @@ def test_list_pipeline_jobs_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2823,7 +2831,7 @@ async def test_list_pipeline_jobs_field_headers_async(): # a field header. Set these to a non-empty value. request = pipeline_service.ListPipelineJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2843,7 +2851,7 @@ async def test_list_pipeline_jobs_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2980,7 +2988,7 @@ def test_list_pipeline_jobs_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, pipeline_job.PipelineJob) for i in results) @@ -3228,7 +3236,7 @@ def test_delete_pipeline_job_field_headers(): # a field header. Set these to a non-empty value. request = pipeline_service.DeletePipelineJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3246,7 +3254,7 @@ def test_delete_pipeline_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3260,7 +3268,7 @@ async def test_delete_pipeline_job_field_headers_async(): # a field header. Set these to a non-empty value. request = pipeline_service.DeletePipelineJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3280,7 +3288,7 @@ async def test_delete_pipeline_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3467,7 +3475,7 @@ def test_cancel_pipeline_job_field_headers(): # a field header. Set these to a non-empty value. request = pipeline_service.CancelPipelineJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3485,7 +3493,7 @@ def test_cancel_pipeline_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3499,7 +3507,7 @@ async def test_cancel_pipeline_job_field_headers_async(): # a field header. Set these to a non-empty value. request = pipeline_service.CancelPipelineJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3517,7 +3525,7 @@ async def test_cancel_pipeline_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_prediction_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_prediction_service.py index 830e533ade..987d023874 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_prediction_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_prediction_service.py @@ -778,7 +778,7 @@ def test_predict_field_headers(): # a field header. Set these to a non-empty value. request = prediction_service.PredictRequest() - request.endpoint = "endpoint/value" + request.endpoint = "endpoint_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.predict), "__call__") as call: @@ -794,7 +794,7 @@ def test_predict_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "endpoint=endpoint/value", + "endpoint=endpoint_value", ) in kw["metadata"] @@ -808,7 +808,7 @@ async def test_predict_field_headers_async(): # a field header. Set these to a non-empty value. request = prediction_service.PredictRequest() - request.endpoint = "endpoint/value" + request.endpoint = "endpoint_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.predict), "__call__") as call: @@ -826,7 +826,7 @@ async def test_predict_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "endpoint=endpoint/value", + "endpoint=endpoint_value", ) in kw["metadata"] @@ -965,7 +965,7 @@ def test_raw_predict_field_headers(): # a field header. Set these to a non-empty value. request = prediction_service.RawPredictRequest() - request.endpoint = "endpoint/value" + request.endpoint = "endpoint_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.raw_predict), "__call__") as call: @@ -981,7 +981,7 @@ def test_raw_predict_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "endpoint=endpoint/value", + "endpoint=endpoint_value", ) in kw["metadata"] @@ -995,7 +995,7 @@ async def test_raw_predict_field_headers_async(): # a field header. Set these to a non-empty value. request = prediction_service.RawPredictRequest() - request.endpoint = "endpoint/value" + request.endpoint = "endpoint_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.raw_predict), "__call__") as call: @@ -1013,7 +1013,7 @@ async def test_raw_predict_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "endpoint=endpoint/value", + "endpoint=endpoint_value", ) in kw["metadata"] @@ -1207,7 +1207,7 @@ def test_explain_field_headers(): # a field header. Set these to a non-empty value. request = prediction_service.ExplainRequest() - request.endpoint = "endpoint/value" + request.endpoint = "endpoint_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.explain), "__call__") as call: @@ -1223,7 +1223,7 @@ def test_explain_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "endpoint=endpoint/value", + "endpoint=endpoint_value", ) in kw["metadata"] @@ -1237,7 +1237,7 @@ async def test_explain_field_headers_async(): # a field header. Set these to a non-empty value. request = prediction_service.ExplainRequest() - request.endpoint = "endpoint/value" + request.endpoint = "endpoint_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.explain), "__call__") as call: @@ -1255,7 +1255,7 @@ async def test_explain_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "endpoint=endpoint/value", + "endpoint=endpoint_value", ) in kw["metadata"] diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_specialist_pool_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_specialist_pool_service.py index f9c5cd97a5..cb2d05022d 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_specialist_pool_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_specialist_pool_service.py @@ -780,7 +780,7 @@ def test_create_specialist_pool_field_headers(): # a field header. Set these to a non-empty value. request = specialist_pool_service.CreateSpecialistPoolRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -798,7 +798,7 @@ def test_create_specialist_pool_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -812,7 +812,7 @@ async def test_create_specialist_pool_field_headers_async(): # a field header. Set these to a non-empty value. request = specialist_pool_service.CreateSpecialistPoolRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -832,7 +832,7 @@ async def test_create_specialist_pool_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1057,7 +1057,7 @@ def test_get_specialist_pool_field_headers(): # a field header. Set these to a non-empty value. request = specialist_pool_service.GetSpecialistPoolRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1075,7 +1075,7 @@ def test_get_specialist_pool_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1089,7 +1089,7 @@ async def test_get_specialist_pool_field_headers_async(): # a field header. Set these to a non-empty value. request = specialist_pool_service.GetSpecialistPoolRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1109,7 +1109,7 @@ async def test_get_specialist_pool_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1304,7 +1304,7 @@ def test_list_specialist_pools_field_headers(): # a field header. Set these to a non-empty value. request = specialist_pool_service.ListSpecialistPoolsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1322,7 +1322,7 @@ def test_list_specialist_pools_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1336,7 +1336,7 @@ async def test_list_specialist_pools_field_headers_async(): # a field header. Set these to a non-empty value. request = specialist_pool_service.ListSpecialistPoolsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1356,7 +1356,7 @@ async def test_list_specialist_pools_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1493,7 +1493,7 @@ def test_list_specialist_pools_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, specialist_pool.SpecialistPool) for i in results) @@ -1741,7 +1741,7 @@ def test_delete_specialist_pool_field_headers(): # a field header. Set these to a non-empty value. request = specialist_pool_service.DeleteSpecialistPoolRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1759,7 +1759,7 @@ def test_delete_specialist_pool_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1773,7 +1773,7 @@ async def test_delete_specialist_pool_field_headers_async(): # a field header. Set these to a non-empty value. request = specialist_pool_service.DeleteSpecialistPoolRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1793,7 +1793,7 @@ async def test_delete_specialist_pool_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1982,7 +1982,7 @@ def test_update_specialist_pool_field_headers(): # a field header. Set these to a non-empty value. request = specialist_pool_service.UpdateSpecialistPoolRequest() - request.specialist_pool.name = "specialist_pool.name/value" + request.specialist_pool.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2000,7 +2000,7 @@ def test_update_specialist_pool_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "specialist_pool.name=specialist_pool.name/value", + "specialist_pool.name=name_value", ) in kw["metadata"] @@ -2014,7 +2014,7 @@ async def test_update_specialist_pool_field_headers_async(): # a field header. Set these to a non-empty value. request = specialist_pool_service.UpdateSpecialistPoolRequest() - request.specialist_pool.name = "specialist_pool.name/value" + request.specialist_pool.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2034,7 +2034,7 @@ async def test_update_specialist_pool_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "specialist_pool.name=specialist_pool.name/value", + "specialist_pool.name=name_value", ) in kw["metadata"] diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_tensorboard_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_tensorboard_service.py index 0e304036ed..712168fc3a 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_tensorboard_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_tensorboard_service.py @@ -785,7 +785,7 @@ def test_create_tensorboard_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.CreateTensorboardRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -803,7 +803,7 @@ def test_create_tensorboard_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -817,7 +817,7 @@ async def test_create_tensorboard_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.CreateTensorboardRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -837,7 +837,7 @@ async def test_create_tensorboard_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1056,7 +1056,7 @@ def test_get_tensorboard_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.GetTensorboardRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_tensorboard), "__call__") as call: @@ -1072,7 +1072,7 @@ def test_get_tensorboard_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1086,7 +1086,7 @@ async def test_get_tensorboard_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.GetTensorboardRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_tensorboard), "__call__") as call: @@ -1104,7 +1104,7 @@ async def test_get_tensorboard_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1289,7 +1289,7 @@ def test_update_tensorboard_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.UpdateTensorboardRequest() - request.tensorboard.name = "tensorboard.name/value" + request.tensorboard.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1307,7 +1307,7 @@ def test_update_tensorboard_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tensorboard.name=tensorboard.name/value", + "tensorboard.name=name_value", ) in kw["metadata"] @@ -1321,7 +1321,7 @@ async def test_update_tensorboard_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.UpdateTensorboardRequest() - request.tensorboard.name = "tensorboard.name/value" + request.tensorboard.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1341,7 +1341,7 @@ async def test_update_tensorboard_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tensorboard.name=tensorboard.name/value", + "tensorboard.name=name_value", ) in kw["metadata"] @@ -1546,7 +1546,7 @@ def test_list_tensorboards_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.ListTensorboardsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1564,7 +1564,7 @@ def test_list_tensorboards_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1578,7 +1578,7 @@ async def test_list_tensorboards_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.ListTensorboardsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1598,7 +1598,7 @@ async def test_list_tensorboards_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1735,7 +1735,7 @@ def test_list_tensorboards_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, tensorboard.Tensorboard) for i in results) @@ -1983,7 +1983,7 @@ def test_delete_tensorboard_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.DeleteTensorboardRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2001,7 +2001,7 @@ def test_delete_tensorboard_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2015,7 +2015,7 @@ async def test_delete_tensorboard_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.DeleteTensorboardRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2035,7 +2035,7 @@ async def test_delete_tensorboard_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2246,7 +2246,7 @@ def test_create_tensorboard_experiment_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.CreateTensorboardExperimentRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2264,7 +2264,7 @@ def test_create_tensorboard_experiment_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2278,7 +2278,7 @@ async def test_create_tensorboard_experiment_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.CreateTensorboardExperimentRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2298,7 +2298,7 @@ async def test_create_tensorboard_experiment_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2537,7 +2537,7 @@ def test_get_tensorboard_experiment_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.GetTensorboardExperimentRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2555,7 +2555,7 @@ def test_get_tensorboard_experiment_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2569,7 +2569,7 @@ async def test_get_tensorboard_experiment_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.GetTensorboardExperimentRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2589,7 +2589,7 @@ async def test_get_tensorboard_experiment_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2800,7 +2800,7 @@ def test_update_tensorboard_experiment_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.UpdateTensorboardExperimentRequest() - request.tensorboard_experiment.name = "tensorboard_experiment.name/value" + request.tensorboard_experiment.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2818,7 +2818,7 @@ def test_update_tensorboard_experiment_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tensorboard_experiment.name=tensorboard_experiment.name/value", + "tensorboard_experiment.name=name_value", ) in kw["metadata"] @@ -2832,7 +2832,7 @@ async def test_update_tensorboard_experiment_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.UpdateTensorboardExperimentRequest() - request.tensorboard_experiment.name = "tensorboard_experiment.name/value" + request.tensorboard_experiment.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2852,7 +2852,7 @@ async def test_update_tensorboard_experiment_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tensorboard_experiment.name=tensorboard_experiment.name/value", + "tensorboard_experiment.name=name_value", ) in kw["metadata"] @@ -3065,7 +3065,7 @@ def test_list_tensorboard_experiments_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.ListTensorboardExperimentsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3083,7 +3083,7 @@ def test_list_tensorboard_experiments_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3097,7 +3097,7 @@ async def test_list_tensorboard_experiments_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.ListTensorboardExperimentsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3117,7 +3117,7 @@ async def test_list_tensorboard_experiments_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3254,7 +3254,7 @@ def test_list_tensorboard_experiments_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all( isinstance(i, tensorboard_experiment.TensorboardExperiment) for i in results @@ -3507,7 +3507,7 @@ def test_delete_tensorboard_experiment_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.DeleteTensorboardExperimentRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3525,7 +3525,7 @@ def test_delete_tensorboard_experiment_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3539,7 +3539,7 @@ async def test_delete_tensorboard_experiment_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.DeleteTensorboardExperimentRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3559,7 +3559,7 @@ async def test_delete_tensorboard_experiment_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3766,7 +3766,7 @@ def test_create_tensorboard_run_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.CreateTensorboardRunRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3784,7 +3784,7 @@ def test_create_tensorboard_run_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3798,7 +3798,7 @@ async def test_create_tensorboard_run_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.CreateTensorboardRunRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3818,7 +3818,7 @@ async def test_create_tensorboard_run_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4027,7 +4027,7 @@ def test_batch_create_tensorboard_runs_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.BatchCreateTensorboardRunsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4045,7 +4045,7 @@ def test_batch_create_tensorboard_runs_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4059,7 +4059,7 @@ async def test_batch_create_tensorboard_runs_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.BatchCreateTensorboardRunsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4079,7 +4079,7 @@ async def test_batch_create_tensorboard_runs_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4308,7 +4308,7 @@ def test_get_tensorboard_run_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.GetTensorboardRunRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4326,7 +4326,7 @@ def test_get_tensorboard_run_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4340,7 +4340,7 @@ async def test_get_tensorboard_run_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.GetTensorboardRunRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4360,7 +4360,7 @@ async def test_get_tensorboard_run_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4567,7 +4567,7 @@ def test_update_tensorboard_run_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.UpdateTensorboardRunRequest() - request.tensorboard_run.name = "tensorboard_run.name/value" + request.tensorboard_run.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4585,7 +4585,7 @@ def test_update_tensorboard_run_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tensorboard_run.name=tensorboard_run.name/value", + "tensorboard_run.name=name_value", ) in kw["metadata"] @@ -4599,7 +4599,7 @@ async def test_update_tensorboard_run_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.UpdateTensorboardRunRequest() - request.tensorboard_run.name = "tensorboard_run.name/value" + request.tensorboard_run.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4619,7 +4619,7 @@ async def test_update_tensorboard_run_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tensorboard_run.name=tensorboard_run.name/value", + "tensorboard_run.name=name_value", ) in kw["metadata"] @@ -4824,7 +4824,7 @@ def test_list_tensorboard_runs_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.ListTensorboardRunsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4842,7 +4842,7 @@ def test_list_tensorboard_runs_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4856,7 +4856,7 @@ async def test_list_tensorboard_runs_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.ListTensorboardRunsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4876,7 +4876,7 @@ async def test_list_tensorboard_runs_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5013,7 +5013,7 @@ def test_list_tensorboard_runs_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, tensorboard_run.TensorboardRun) for i in results) @@ -5261,7 +5261,7 @@ def test_delete_tensorboard_run_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.DeleteTensorboardRunRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5279,7 +5279,7 @@ def test_delete_tensorboard_run_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5293,7 +5293,7 @@ async def test_delete_tensorboard_run_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.DeleteTensorboardRunRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5313,7 +5313,7 @@ async def test_delete_tensorboard_run_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5508,7 +5508,7 @@ def test_batch_create_tensorboard_time_series_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.BatchCreateTensorboardTimeSeriesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5528,7 +5528,7 @@ def test_batch_create_tensorboard_time_series_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5542,7 +5542,7 @@ async def test_batch_create_tensorboard_time_series_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.BatchCreateTensorboardTimeSeriesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5562,7 +5562,7 @@ async def test_batch_create_tensorboard_time_series_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5825,7 +5825,7 @@ def test_create_tensorboard_time_series_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.CreateTensorboardTimeSeriesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5843,7 +5843,7 @@ def test_create_tensorboard_time_series_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5857,7 +5857,7 @@ async def test_create_tensorboard_time_series_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.CreateTensorboardTimeSeriesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5877,7 +5877,7 @@ async def test_create_tensorboard_time_series_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -6120,7 +6120,7 @@ def test_get_tensorboard_time_series_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.GetTensorboardTimeSeriesRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6138,7 +6138,7 @@ def test_get_tensorboard_time_series_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -6152,7 +6152,7 @@ async def test_get_tensorboard_time_series_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.GetTensorboardTimeSeriesRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6172,7 +6172,7 @@ async def test_get_tensorboard_time_series_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -6397,7 +6397,7 @@ def test_update_tensorboard_time_series_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.UpdateTensorboardTimeSeriesRequest() - request.tensorboard_time_series.name = "tensorboard_time_series.name/value" + request.tensorboard_time_series.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6415,7 +6415,7 @@ def test_update_tensorboard_time_series_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tensorboard_time_series.name=tensorboard_time_series.name/value", + "tensorboard_time_series.name=name_value", ) in kw["metadata"] @@ -6429,7 +6429,7 @@ async def test_update_tensorboard_time_series_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.UpdateTensorboardTimeSeriesRequest() - request.tensorboard_time_series.name = "tensorboard_time_series.name/value" + request.tensorboard_time_series.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6449,7 +6449,7 @@ async def test_update_tensorboard_time_series_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tensorboard_time_series.name=tensorboard_time_series.name/value", + "tensorboard_time_series.name=name_value", ) in kw["metadata"] @@ -6662,7 +6662,7 @@ def test_list_tensorboard_time_series_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.ListTensorboardTimeSeriesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6680,7 +6680,7 @@ def test_list_tensorboard_time_series_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -6694,7 +6694,7 @@ async def test_list_tensorboard_time_series_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.ListTensorboardTimeSeriesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6714,7 +6714,7 @@ async def test_list_tensorboard_time_series_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -6851,7 +6851,7 @@ def test_list_tensorboard_time_series_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all( isinstance(i, tensorboard_time_series.TensorboardTimeSeries) @@ -7105,7 +7105,7 @@ def test_delete_tensorboard_time_series_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.DeleteTensorboardTimeSeriesRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7123,7 +7123,7 @@ def test_delete_tensorboard_time_series_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -7137,7 +7137,7 @@ async def test_delete_tensorboard_time_series_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.DeleteTensorboardTimeSeriesRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7157,7 +7157,7 @@ async def test_delete_tensorboard_time_series_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -7358,7 +7358,7 @@ def test_batch_read_tensorboard_time_series_data_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.BatchReadTensorboardTimeSeriesDataRequest() - request.tensorboard = "tensorboard/value" + request.tensorboard = "tensorboard_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7378,7 +7378,7 @@ def test_batch_read_tensorboard_time_series_data_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tensorboard=tensorboard/value", + "tensorboard=tensorboard_value", ) in kw["metadata"] @@ -7392,7 +7392,7 @@ async def test_batch_read_tensorboard_time_series_data_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.BatchReadTensorboardTimeSeriesDataRequest() - request.tensorboard = "tensorboard/value" + request.tensorboard = "tensorboard_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7412,7 +7412,7 @@ async def test_batch_read_tensorboard_time_series_data_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tensorboard=tensorboard/value", + "tensorboard=tensorboard_value", ) in kw["metadata"] @@ -7609,7 +7609,7 @@ def test_read_tensorboard_time_series_data_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.ReadTensorboardTimeSeriesDataRequest() - request.tensorboard_time_series = "tensorboard_time_series/value" + request.tensorboard_time_series = "tensorboard_time_series_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7627,7 +7627,7 @@ def test_read_tensorboard_time_series_data_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tensorboard_time_series=tensorboard_time_series/value", + "tensorboard_time_series=tensorboard_time_series_value", ) in kw["metadata"] @@ -7641,7 +7641,7 @@ async def test_read_tensorboard_time_series_data_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.ReadTensorboardTimeSeriesDataRequest() - request.tensorboard_time_series = "tensorboard_time_series/value" + request.tensorboard_time_series = "tensorboard_time_series_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7661,7 +7661,7 @@ async def test_read_tensorboard_time_series_data_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tensorboard_time_series=tensorboard_time_series/value", + "tensorboard_time_series=tensorboard_time_series_value", ) in kw["metadata"] @@ -7855,7 +7855,7 @@ def test_read_tensorboard_blob_data_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.ReadTensorboardBlobDataRequest() - request.time_series = "time_series/value" + request.time_series = "time_series_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7875,7 +7875,7 @@ def test_read_tensorboard_blob_data_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "time_series=time_series/value", + "time_series=time_series_value", ) in kw["metadata"] @@ -7889,7 +7889,7 @@ async def test_read_tensorboard_blob_data_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.ReadTensorboardBlobDataRequest() - request.time_series = "time_series/value" + request.time_series = "time_series_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7910,7 +7910,7 @@ async def test_read_tensorboard_blob_data_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "time_series=time_series/value", + "time_series=time_series_value", ) in kw["metadata"] @@ -8105,7 +8105,7 @@ def test_write_tensorboard_experiment_data_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.WriteTensorboardExperimentDataRequest() - request.tensorboard_experiment = "tensorboard_experiment/value" + request.tensorboard_experiment = "tensorboard_experiment_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8123,7 +8123,7 @@ def test_write_tensorboard_experiment_data_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tensorboard_experiment=tensorboard_experiment/value", + "tensorboard_experiment=tensorboard_experiment_value", ) in kw["metadata"] @@ -8137,7 +8137,7 @@ async def test_write_tensorboard_experiment_data_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.WriteTensorboardExperimentDataRequest() - request.tensorboard_experiment = "tensorboard_experiment/value" + request.tensorboard_experiment = "tensorboard_experiment_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8157,7 +8157,7 @@ async def test_write_tensorboard_experiment_data_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tensorboard_experiment=tensorboard_experiment/value", + "tensorboard_experiment=tensorboard_experiment_value", ) in kw["metadata"] @@ -8380,7 +8380,7 @@ def test_write_tensorboard_run_data_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.WriteTensorboardRunDataRequest() - request.tensorboard_run = "tensorboard_run/value" + request.tensorboard_run = "tensorboard_run_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8398,7 +8398,7 @@ def test_write_tensorboard_run_data_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tensorboard_run=tensorboard_run/value", + "tensorboard_run=tensorboard_run_value", ) in kw["metadata"] @@ -8412,7 +8412,7 @@ async def test_write_tensorboard_run_data_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.WriteTensorboardRunDataRequest() - request.tensorboard_run = "tensorboard_run/value" + request.tensorboard_run = "tensorboard_run_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8432,7 +8432,7 @@ async def test_write_tensorboard_run_data_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tensorboard_run=tensorboard_run/value", + "tensorboard_run=tensorboard_run_value", ) in kw["metadata"] @@ -8661,7 +8661,7 @@ def test_export_tensorboard_time_series_data_field_headers(): # a field header. Set these to a non-empty value. request = tensorboard_service.ExportTensorboardTimeSeriesDataRequest() - request.tensorboard_time_series = "tensorboard_time_series/value" + request.tensorboard_time_series = "tensorboard_time_series_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8681,7 +8681,7 @@ def test_export_tensorboard_time_series_data_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tensorboard_time_series=tensorboard_time_series/value", + "tensorboard_time_series=tensorboard_time_series_value", ) in kw["metadata"] @@ -8695,7 +8695,7 @@ async def test_export_tensorboard_time_series_data_field_headers_async(): # a field header. Set these to a non-empty value. request = tensorboard_service.ExportTensorboardTimeSeriesDataRequest() - request.tensorboard_time_series = "tensorboard_time_series/value" + request.tensorboard_time_series = "tensorboard_time_series_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -8715,7 +8715,7 @@ async def test_export_tensorboard_time_series_data_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tensorboard_time_series=tensorboard_time_series/value", + "tensorboard_time_series=tensorboard_time_series_value", ) in kw["metadata"] @@ -8858,7 +8858,7 @@ def test_export_tensorboard_time_series_data_pager(transport_name: str = "grpc") assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, tensorboard_data.TimeSeriesDataPoint) for i in results) diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_vizier_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_vizier_service.py index 8688f8e3aa..a73602e3e0 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_vizier_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_vizier_service.py @@ -767,7 +767,7 @@ def test_create_study_field_headers(): # a field header. Set these to a non-empty value. request = vizier_service.CreateStudyRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_study), "__call__") as call: @@ -783,7 +783,7 @@ def test_create_study_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -797,7 +797,7 @@ async def test_create_study_field_headers_async(): # a field header. Set these to a non-empty value. request = vizier_service.CreateStudyRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_study), "__call__") as call: @@ -813,7 +813,7 @@ async def test_create_study_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1017,7 +1017,7 @@ def test_get_study_field_headers(): # a field header. Set these to a non-empty value. request = vizier_service.GetStudyRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_study), "__call__") as call: @@ -1033,7 +1033,7 @@ def test_get_study_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1047,7 +1047,7 @@ async def test_get_study_field_headers_async(): # a field header. Set these to a non-empty value. request = vizier_service.GetStudyRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_study), "__call__") as call: @@ -1063,7 +1063,7 @@ async def test_get_study_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1245,7 +1245,7 @@ def test_list_studies_field_headers(): # a field header. Set these to a non-empty value. request = vizier_service.ListStudiesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_studies), "__call__") as call: @@ -1261,7 +1261,7 @@ def test_list_studies_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1275,7 +1275,7 @@ async def test_list_studies_field_headers_async(): # a field header. Set these to a non-empty value. request = vizier_service.ListStudiesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_studies), "__call__") as call: @@ -1293,7 +1293,7 @@ async def test_list_studies_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1424,7 +1424,7 @@ def test_list_studies_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, study.Study) for i in results) @@ -1657,7 +1657,7 @@ def test_delete_study_field_headers(): # a field header. Set these to a non-empty value. request = vizier_service.DeleteStudyRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_study), "__call__") as call: @@ -1673,7 +1673,7 @@ def test_delete_study_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1687,7 +1687,7 @@ async def test_delete_study_field_headers_async(): # a field header. Set these to a non-empty value. request = vizier_service.DeleteStudyRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_study), "__call__") as call: @@ -1703,7 +1703,7 @@ async def test_delete_study_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1897,7 +1897,7 @@ def test_lookup_study_field_headers(): # a field header. Set these to a non-empty value. request = vizier_service.LookupStudyRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.lookup_study), "__call__") as call: @@ -1913,7 +1913,7 @@ def test_lookup_study_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1927,7 +1927,7 @@ async def test_lookup_study_field_headers_async(): # a field header. Set these to a non-empty value. request = vizier_service.LookupStudyRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.lookup_study), "__call__") as call: @@ -1943,7 +1943,7 @@ async def test_lookup_study_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2119,7 +2119,7 @@ def test_suggest_trials_field_headers(): # a field header. Set these to a non-empty value. request = vizier_service.SuggestTrialsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.suggest_trials), "__call__") as call: @@ -2135,7 +2135,7 @@ def test_suggest_trials_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2149,7 +2149,7 @@ async def test_suggest_trials_field_headers_async(): # a field header. Set these to a non-empty value. request = vizier_service.SuggestTrialsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.suggest_trials), "__call__") as call: @@ -2167,7 +2167,7 @@ async def test_suggest_trials_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2289,7 +2289,7 @@ def test_create_trial_field_headers(): # a field header. Set these to a non-empty value. request = vizier_service.CreateTrialRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_trial), "__call__") as call: @@ -2305,7 +2305,7 @@ def test_create_trial_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2319,7 +2319,7 @@ async def test_create_trial_field_headers_async(): # a field header. Set these to a non-empty value. request = vizier_service.CreateTrialRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_trial), "__call__") as call: @@ -2335,7 +2335,7 @@ async def test_create_trial_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2547,7 +2547,7 @@ def test_get_trial_field_headers(): # a field header. Set these to a non-empty value. request = vizier_service.GetTrialRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_trial), "__call__") as call: @@ -2563,7 +2563,7 @@ def test_get_trial_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2577,7 +2577,7 @@ async def test_get_trial_field_headers_async(): # a field header. Set these to a non-empty value. request = vizier_service.GetTrialRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_trial), "__call__") as call: @@ -2593,7 +2593,7 @@ async def test_get_trial_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2775,7 +2775,7 @@ def test_list_trials_field_headers(): # a field header. Set these to a non-empty value. request = vizier_service.ListTrialsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_trials), "__call__") as call: @@ -2791,7 +2791,7 @@ def test_list_trials_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2805,7 +2805,7 @@ async def test_list_trials_field_headers_async(): # a field header. Set these to a non-empty value. request = vizier_service.ListTrialsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_trials), "__call__") as call: @@ -2823,7 +2823,7 @@ async def test_list_trials_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2954,7 +2954,7 @@ def test_list_trials_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, study.Trial) for i in results) @@ -3222,7 +3222,7 @@ def test_add_trial_measurement_field_headers(): # a field header. Set these to a non-empty value. request = vizier_service.AddTrialMeasurementRequest() - request.trial_name = "trial_name/value" + request.trial_name = "trial_name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3240,7 +3240,7 @@ def test_add_trial_measurement_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "trial_name=trial_name/value", + "trial_name=trial_name_value", ) in kw["metadata"] @@ -3254,7 +3254,7 @@ async def test_add_trial_measurement_field_headers_async(): # a field header. Set these to a non-empty value. request = vizier_service.AddTrialMeasurementRequest() - request.trial_name = "trial_name/value" + request.trial_name = "trial_name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3272,7 +3272,7 @@ async def test_add_trial_measurement_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "trial_name=trial_name/value", + "trial_name=trial_name_value", ) in kw["metadata"] @@ -3394,7 +3394,7 @@ def test_complete_trial_field_headers(): # a field header. Set these to a non-empty value. request = vizier_service.CompleteTrialRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.complete_trial), "__call__") as call: @@ -3410,7 +3410,7 @@ def test_complete_trial_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3424,7 +3424,7 @@ async def test_complete_trial_field_headers_async(): # a field header. Set these to a non-empty value. request = vizier_service.CompleteTrialRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.complete_trial), "__call__") as call: @@ -3440,7 +3440,7 @@ async def test_complete_trial_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3534,7 +3534,7 @@ def test_delete_trial_field_headers(): # a field header. Set these to a non-empty value. request = vizier_service.DeleteTrialRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_trial), "__call__") as call: @@ -3550,7 +3550,7 @@ def test_delete_trial_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3564,7 +3564,7 @@ async def test_delete_trial_field_headers_async(): # a field header. Set these to a non-empty value. request = vizier_service.DeleteTrialRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_trial), "__call__") as call: @@ -3580,7 +3580,7 @@ async def test_delete_trial_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3763,7 +3763,7 @@ def test_check_trial_early_stopping_state_field_headers(): # a field header. Set these to a non-empty value. request = vizier_service.CheckTrialEarlyStoppingStateRequest() - request.trial_name = "trial_name/value" + request.trial_name = "trial_name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3781,7 +3781,7 @@ def test_check_trial_early_stopping_state_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "trial_name=trial_name/value", + "trial_name=trial_name_value", ) in kw["metadata"] @@ -3795,7 +3795,7 @@ async def test_check_trial_early_stopping_state_field_headers_async(): # a field header. Set these to a non-empty value. request = vizier_service.CheckTrialEarlyStoppingStateRequest() - request.trial_name = "trial_name/value" + request.trial_name = "trial_name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3815,7 +3815,7 @@ async def test_check_trial_early_stopping_state_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "trial_name=trial_name/value", + "trial_name=trial_name_value", ) in kw["metadata"] @@ -3937,7 +3937,7 @@ def test_stop_trial_field_headers(): # a field header. Set these to a non-empty value. request = vizier_service.StopTrialRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.stop_trial), "__call__") as call: @@ -3953,7 +3953,7 @@ def test_stop_trial_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3967,7 +3967,7 @@ async def test_stop_trial_field_headers_async(): # a field header. Set these to a non-empty value. request = vizier_service.StopTrialRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.stop_trial), "__call__") as call: @@ -3983,7 +3983,7 @@ async def test_stop_trial_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4086,7 +4086,7 @@ def test_list_optimal_trials_field_headers(): # a field header. Set these to a non-empty value. request = vizier_service.ListOptimalTrialsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4104,7 +4104,7 @@ def test_list_optimal_trials_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4118,7 +4118,7 @@ async def test_list_optimal_trials_field_headers_async(): # a field header. Set these to a non-empty value. request = vizier_service.ListOptimalTrialsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4138,7 +4138,7 @@ async def test_list_optimal_trials_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"]