Class EntityType (1.8.1)

EntityType(
    entity_type_name: str,
    featurestore_id: Optional[str] = None,
    project: Optional[str] = None,
    location: Optional[str] = None,
    credentials: Optional[google.auth.credentials.Credentials] = None,
)

Managed entityType resource for Vertex AI.

Inheritance

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

Properties

featurestore_name

Full qualified resource name of the managed featurestore in which this EntityType is.

Methods

EntityType

EntityType(
    entity_type_name: str,
    featurestore_id: Optional[str] = None,
    project: Optional[str] = None,
    location: Optional[str] = None,
    credentials: Optional[google.auth.credentials.Credentials] = None,
)

Retrieves an existing managed entityType given an entityType resource name or an entity_type ID.

Example Usage:

my_entity_type = aiplatform.EntityType(
    entity_type_name='projects/123/locations/us-central1/featurestores/my_featurestore_id/                entityTypes/my_entity_type_id'
)
or
my_entity_type = aiplatform.EntityType(
    entity_type_name='my_entity_type_id',
    featurestore_id='my_featurestore_id',
)
Parameters
Name Description
entity_type_name str

Required. A fully-qualified entityType resource name or an entity_type ID. Example: "projects/123/locations/us-central1/featurestores/my_featurestore_id/entityTypes/my_entity_type_id" or "my_entity_type_id" when project and location are initialized or passed, with featurestore_id passed.

featurestore_id str

Optional. Featurestore ID to retrieve entityType from, when entity_type_name is passed as entity_type ID.

project str

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

location str

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

credentials auth_credentials.Credentials

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

delete_features

delete_features(feature_ids: List[str], sync: bool = True)

Deletes feature resources in this EntityType given their feature IDs. WARNING: This deletion is permanent.

Parameters
Name Description
feature_ids List[str]

Required. The list of feature 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.

get_feature

get_feature(feature_id: str)

Retrieves an existing managed feature in this EntityType.

Parameter
Name Description
feature_id str

Required. The managed feature resource ID in this EntityType.

get_featurestore

get_featurestore()

Retrieves the managed featurestore in which this EntityType is.

list

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

Lists existing managed entityType resources in a featurestore, given a featurestore resource name or a featurestore ID.

Example Usage:

my_entityTypes = aiplatform.EntityType.list(
    featurestore_name='projects/123/locations/us-central1/featurestores/my_featurestore_id'
)
or
my_entityTypes = aiplatform.EntityType.list(
    featurestore_name='my_featurestore_id'
)
Parameters
Name Description
featurestore_name str

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

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

project str

Optional. Project to list entityTypes in. If not set, project set in aiplatform.init will be used.

location str

Optional. Location to list entityTypes in. If not set, location set in aiplatform.init will be used.

credentials auth_credentials.Credentials

Optional. Custom credentials to use to list entityTypes. Overrides credentials set in aiplatform.init.

list_features

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

Lists existing managed feature resources in this EntityType.

Example Usage:

my_entity_type = aiplatform.EntityType(
    entity_type_name='my_entity_type_id',
    featurestore_id='my_featurestore_id',
)
my_entityType.list_features()
Parameters
Name Description
filter str

Optional. Lists the Features that match the filter expression. The following filters are supported: - value_type: Supports = and != comparisons. - 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: - value_type = DOUBLE --> Features whose type is DOUBLE. - 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 --> Features having both (active: yes) and (env: prod) labels. - labels.env: * --> Any Feature 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: - feature_id - value_type - create_time - update_time

update

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

Updates an existing managed entityType resource.

Example Usage:

my_entity_type = aiplatform.EntityType(
    entity_type_name='my_entity_type_id',
    featurestore_id='my_featurestore_id',
)
my_entity_type.update(
    description='update my description',
)
Parameters
Name Description
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 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.