Class Featurestore (1.9.0)

Featurestore(
    featurestore_name: str,
    project: Optional[str] = None,
    location: Optional[str] = None,
    credentials: Optional[google.auth.credentials.Credentials] = None,
)

Managed featurestore resource for Vertex AI.

Inheritance

builtins.object > google.cloud.aiplatform.base.VertexAiResourceNoun > builtins.object > google.cloud.aiplatform.base.FutureManager > google.cloud.aiplatform.base.VertexAiResourceNounWithFutureManager > Featurestore

Methods

Featurestore

Featurestore(
    featurestore_name: str,
    project: Optional[str] = None,
    location: Optional[str] = None,
    credentials: Optional[google.auth.credentials.Credentials] = None,
)

Retrieves an existing managed featurestore given a featurestore resource name or a featurestore ID.

Example Usage:

my_featurestore = aiplatform.Featurestore(
    featurestore_name='projects/123/locations/us-central1/featurestores/my_featurestore_id'
)
or
my_featurestore = aiplatform.Featurestore(
    featurestore_name='my_featurestore_id'
)
Parameters
NameDescription
featurestore_name str

Required. A fully-qualified featurestore resource name or a featurestore ID. Example: "projects/123/locations/us-central1/featurestores/my_featurestore_id" or "my_featurestore_id" when project and location are initialized or passed.

project str

Optional. Project to retrieve featurestore from. If not set, project set in aiplatform.init will be used.

location str

Optional. Location to retrieve featurestore from. If not set, location set in aiplatform.init will be used.

credentials auth_credentials.Credentials

Optional. Custom credentials to use to retrieve this Featurestore. Overrides credentials set in aiplatform.init.

create

create(
    featurestore_id: str,
    online_store_fixed_node_count: Optional[int] = None,
    labels: Optional[Dict[str, str]] = None,
    project: Optional[str] = None,
    location: Optional[str] = None,
    credentials: Optional[google.auth.credentials.Credentials] = None,
    request_metadata: Optional[Sequence[Tuple[str, str]]] = (),
    encryption_spec_key_name: Optional[str] = None,
    sync: bool = True,
)

Creates a Featurestore resource.

Example Usage:

my_entity_type = aiplatform.EntityType.create(
    entity_type_id='my_entity_type_id',
    featurestore_name='projects/123/locations/us-central1/featurestores/my_featurestore_id'
)
or
my_entity_type = aiplatform.EntityType.create(
    entity_type_id='my_entity_type_id',
    featurestore_name='my_featurestore_id',
)
Parameters
NameDescription
featurestore_id str

Required. The ID to use for this Featurestore, which will become the final component of the Featurestore's resource name. This value may be up to 60 characters, and valid characters are [a-z0-9_]. The first character cannot be a number. The value must be unique within the project and location.

online_store_fixed_node_count int

Optional. Config for online serving resources. When not specified, default node count is 1. The number of nodes will not scale automatically but can be scaled manually by providing different values when updating.

labels Dict[str, str]

Optional. The labels with user-defined metadata to organize your Featurestore. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information on and examples of labels. No more than 64 user labels can be associated with one Featurestore(System labels are excluded)." System reserved label keys are prefixed with "aiplatform.googleapis.com/" and are immutable.

project str

Optional. Project to create EntityType in. If not set, project set in aiplatform.init will be used.

location str

Optional. Location to create EntityType in. If not set, location set in aiplatform.init will be used.

credentials auth_credentials.Credentials

Optional. Custom credentials to use to create EntityTypes. Overrides credentials set in aiplatform.init.

request_metadata Sequence[Tuple[str, str]]

Optional. Strings which should be sent along with the request as metadata.

encryption_spec str

Optional. Customer-managed encryption key spec for data storage. If set, both of the online and offline data storage will be secured by this key.

sync bool

Optional. Whether to execute this creation synchronously. If False, this method will be executed in concurrent Future and any downstream object will be immediately returned and synced when the Future has completed.

create_entity_type

create_entity_type(
    entity_type_id: str,
    description: Optional[str] = None,
    labels: Optional[Dict[str, str]] = None,
    request_metadata: Optional[Sequence[Tuple[str, str]]] = (),
    sync: bool = True,
)

Creates an EntityType resource in this Featurestore.

Example Usage:

my_featurestore = aiplatform.Featurestore.create(
    featurestore_id='my_featurestore_id'
)
my_entity_type = my_featurestore.create_entity_type(
    entity_type_id='my_entity_type_id',
)
Parameters
NameDescription
entity_type_id str

Required. The ID to use for the EntityType, which will become the final component of the EntityType's resource name. This value may be up to 60 characters, and valid characters are [a-z0-9_]. The first character cannot be a number. The value must be unique within a featurestore.

description str

Optional. Description of the EntityType.

labels Dict[str, str]

Optional. The labels with user-defined metadata to organize your EntityTypes. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information on and examples of labels. No more than 64 user labels can be associated with one EntityType (System labels are excluded)." System reserved label keys are prefixed with "aiplatform.googleapis.com/" and are immutable.

request_metadata Sequence[Tuple[str, str]]

Optional. Strings which should be sent along with the request as metadata.

sync bool

Optional. Whether to execute this creation synchronously. If False, this method will be executed in concurrent Future and any downstream object will be immediately returned and synced when the Future has completed.

delete

delete(sync: bool = True, force: bool = False)

Deletes this Featurestore resource. If force is set to True, all entityTypes in this Featurestore will be deleted prior to featurestore deletion, and all features in each entityType will be deleted prior to each entityType deletion.

WARNING: This deletion is permanent.

Parameters
NameDescription
force bool

If set to true, any EntityTypes and Features for this Featurestore will also be deleted. (Otherwise, the request will only work if the Featurestore has no EntityTypes.)

sync bool

Whether to execute this deletion synchronously. If False, this method will be executed in concurrent Future and any downstream object will be immediately returned and synced when the Future has completed.

delete_entity_types

delete_entity_types(
    entity_type_ids: List[str], sync: bool = True, force: bool = False
)

Deletes entity_type resources in this Featurestore given their entity_type IDs. WARNING: This deletion is permanent.

Parameters
NameDescription
entity_type_ids List[str]

Required. The list of entity_type IDs to be deleted.

sync bool

Optional. Whether to execute this deletion synchronously. If False, this method will be executed in concurrent Future and any downstream object will be immediately returned and synced when the Future has completed.

force bool

Optional. If force is set to True, all features in each entityType will be deleted prior to entityType deletion. Default is False.

get_entity_type

get_entity_type(entity_type_id: str)

Retrieves an existing managed entityType in this Featurestore.

Parameter
NameDescription
entity_type_id str

Required. The managed entityType resource ID in this Featurestore.

list_entity_types

list_entity_types(filter: Optional[str] = None, order_by: Optional[str] = None)

Lists existing managed entityType resources in this Featurestore.

Example Usage:

my_featurestore = aiplatform.Featurestore(
    featurestore_name='my_featurestore_id',
)
my_featurestore.list_entity_types()
Parameters
NameDescription
filter str

Optional. Lists the EntityTypes that match the filter expression. The following filters are supported: - create_time: Supports =, !=, <, >, >=, and <= comparisons. Values must be in RFC 3339 format. - update_time: Supports =, !=, <, >, >=, and <= comparisons. Values must be in RFC 3339 format. - labels: Supports key-value equality as well as key presence. Examples: - create_time > "2020-01-31T15:30:00.000000Z" OR update_time > "2020-01-31T15:30:00.000000Z" --> EntityTypes created or updated after 2020-01-31T15:30:00.000000Z. - labels.active = yes AND labels.env = prod --> EntityTypes having both (active: yes) and (env: prod) labels. - labels.env: * --> Any EntityType which has a label with 'env' as the key.

order_by str

Optional. A comma-separated list of fields to order by, sorted in ascending order. Use "desc" after a field name for descending. Supported fields: - entity_type_id - create_time - update_time

update

update(
    labels: Optional[Dict[str, str]] = None,
    request_metadata: Optional[Sequence[Tuple[str, str]]] = (),
)

Updates an existing managed featurestore resource.

Example Usage:

my_featurestore = aiplatform.Featurestore(
    featurestore_name='my_featurestore_id',
)
my_featurestore.update(
    labels={'update my key': 'update my value'},
)
Parameters
NameDescription
labels Dict[str, str]

Optional. The labels with user-defined metadata to organize your Featurestores. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information on and examples of labels. No more than 64 user labels can be associated with one Feature (System labels are excluded)." System reserved label keys are prefixed with "aiplatform.googleapis.com/" and are immutable.

request_metadata Sequence[Tuple[str, str]]

Optional. Strings which should be sent along with the request as metadata.

update_online_store

update_online_store(
    fixed_node_count: int, request_metadata: Optional[Sequence[Tuple[str, str]]] = ()
)

Updates the online store of an existing managed featurestore resource.

Example Usage:

my_featurestore = aiplatform.Featurestore(
    featurestore_name='my_featurestore_id',
)
my_featurestore.update_online_store(
    fixed_node_count=2,
)
Parameters
NameDescription
fixed_node_count int

Required. Config for online serving resources, can only update the node count to >= 1.

request_metadata Sequence[Tuple[str, str]]

Optional. Strings which should be sent along with the request as metadata.