Beispiel #1
0
async def sample_batch_read_feature_values():
    # Create a client
    client = aiplatform_v1.FeaturestoreServiceAsyncClient()

    # Initialize request argument(s)
    csv_read_instances = aiplatform_v1.CsvSource()
    csv_read_instances.gcs_source.uris = ['uris_value_1', 'uris_value_2']

    destination = aiplatform_v1.FeatureValueDestination()
    destination.bigquery_destination.output_uri = "output_uri_value"

    entity_type_specs = aiplatform_v1.EntityTypeSpec()
    entity_type_specs.entity_type_id = "entity_type_id_value"
    entity_type_specs.feature_selector.id_matcher.ids = [
        'ids_value_1', 'ids_value_2'
    ]

    request = aiplatform_v1.BatchReadFeatureValuesRequest(
        csv_read_instances=csv_read_instances,
        featurestore="featurestore_value",
        destination=destination,
        entity_type_specs=entity_type_specs,
    )

    # Make the request
    operation = client.batch_read_feature_values(request=request)

    print("Waiting for operation to complete...")

    response = await operation.result()

    # Handle the response
    print(response)
async def sample_export_feature_values():
    # Create a client
    client = aiplatform_v1.FeaturestoreServiceAsyncClient()

    # Initialize request argument(s)
    destination = aiplatform_v1.FeatureValueDestination()
    destination.bigquery_destination.output_uri = "output_uri_value"

    feature_selector = aiplatform_v1.FeatureSelector()
    feature_selector.id_matcher.ids = ['ids_value_1', 'ids_value_2']

    request = aiplatform_v1.ExportFeatureValuesRequest(
        entity_type="entity_type_value",
        destination=destination,
        feature_selector=feature_selector,
    )

    # Make the request
    operation = client.export_feature_values(request=request)

    print("Waiting for operation to complete...")

    response = await operation.result()

    # Handle the response
    print(response)
Beispiel #3
0
async def sample_import_feature_values():
    # Create a client
    client = aiplatform_v1.FeaturestoreServiceAsyncClient()

    # Initialize request argument(s)
    avro_source = aiplatform_v1.AvroSource()
    avro_source.gcs_source.uris = ['uris_value_1', 'uris_value_2']

    feature_specs = aiplatform_v1.FeatureSpec()
    feature_specs.id = "id_value"

    request = aiplatform_v1.ImportFeatureValuesRequest(
        avro_source=avro_source,
        feature_time_field="feature_time_field_value",
        entity_type="entity_type_value",
        feature_specs=feature_specs,
    )

    # Make the request
    operation = client.import_feature_values(request=request)

    print("Waiting for operation to complete...")

    response = await operation.result()

    # Handle the response
    print(response)
async def sample_update_entity_type():
    # Create a client
    client = aiplatform_v1.FeaturestoreServiceAsyncClient()

    # Initialize request argument(s)
    request = aiplatform_v1.UpdateEntityTypeRequest()

    # Make the request
    response = await client.update_entity_type(request=request)

    # Handle the response
    print(response)
async def sample_get_feature():
    # Create a client
    client = aiplatform_v1.FeaturestoreServiceAsyncClient()

    # Initialize request argument(s)
    request = aiplatform_v1.GetFeatureRequest(name="name_value", )

    # Make the request
    response = await client.get_feature(request=request)

    # Handle the response
    print(response)
Beispiel #6
0
async def sample_search_features():
    # Create a client
    client = aiplatform_v1.FeaturestoreServiceAsyncClient()

    # Initialize request argument(s)
    request = aiplatform_v1.SearchFeaturesRequest(location="location_value", )

    # Make the request
    page_result = client.search_features(request=request)

    # Handle the response
    async for response in page_result:
        print(response)
Beispiel #7
0
async def sample_list_features():
    # Create a client
    client = aiplatform_v1.FeaturestoreServiceAsyncClient()

    # Initialize request argument(s)
    request = aiplatform_v1.ListFeaturesRequest(parent="parent_value", )

    # Make the request
    page_result = client.list_features(request=request)

    # Handle the response
    async for response in page_result:
        print(response)
async def sample_update_feature():
    # Create a client
    client = aiplatform_v1.FeaturestoreServiceAsyncClient()

    # Initialize request argument(s)
    feature = aiplatform_v1.Feature()
    feature.value_type = "BYTES"

    request = aiplatform_v1.UpdateFeatureRequest(feature=feature, )

    # Make the request
    response = await client.update_feature(request=request)

    # Handle the response
    print(response)
async def sample_update_featurestore():
    # Create a client
    client = aiplatform_v1.FeaturestoreServiceAsyncClient()

    # Initialize request argument(s)
    request = aiplatform_v1.UpdateFeaturestoreRequest()

    # Make the request
    operation = client.update_featurestore(request=request)

    print("Waiting for operation to complete...")

    response = await operation.result()

    # Handle the response
    print(response)
async def sample_delete_entity_type():
    # Create a client
    client = aiplatform_v1.FeaturestoreServiceAsyncClient()

    # Initialize request argument(s)
    request = aiplatform_v1.DeleteEntityTypeRequest(name="name_value", )

    # Make the request
    operation = client.delete_entity_type(request=request)

    print("Waiting for operation to complete...")

    response = await operation.result()

    # Handle the response
    print(response)
async def sample_create_feature():
    # Create a client
    client = aiplatform_v1.FeaturestoreServiceAsyncClient()

    # Initialize request argument(s)
    feature = aiplatform_v1.Feature()
    feature.value_type = "BYTES"

    request = aiplatform_v1.CreateFeatureRequest(
        parent="parent_value",
        feature=feature,
        feature_id="feature_id_value",
    )

    # Make the request
    operation = client.create_feature(request=request)

    print("Waiting for operation to complete...")

    response = await operation.result()

    # Handle the response
    print(response)