Skip to main content
Version: 1.0

Entity

Summary​

A Tecton Entity, used to organize and join features.
 
An Entity is a class that represents an Entity that is being modeled in Tecton. Entities are used to index and organize features - a FeatureView contains at least one Entity.
 
Entities contain metadata about join keys, which represent the columns that are used to join features together.

Example

from tecton import Entity
from tecton.types import Field, String
customer = Entity(
name='customer',
join_keys=[Field('customer_id', String)],
description='A customer subscribing to a Sports TV subscription service',
owner='matt@tecton.ai',
tags={'release': 'development'}

Attributes​

NameData TypeDescription
created_atOptional[datetime.datetime]Returns the time that this Tecton object was created or last updated. None for locally defined objects.
defined_inOptional[str]The repo filename where this object was declared. None for locally defined objects.
descriptionOptional[str]Returns the description of the Tecton object.
idstrReturns the unique id of the Tecton object.
info
join_keysList[str]Join keys of the entity.
namestrReturns the name of the Tecton object.
ownerOptional[str]Returns the owner of the Tecton object.
prevent_destroyboolReturn whether entity has prevent_destroy flagged
tagsDict[str, str]Returns the tags of the Tecton object.
workspaceOptional[str]Returns the workspace that this Tecton object belongs to. None for locally defined objects.

Methods​

NameDescription
__init__(...)Declare a new Entity.
summary()Displays a human-readable summary.
validate()Method is deprecated and will be removed in a future version. As of Tecton version 1.0, objects are validated upon object creation, so validation is unnecessary.

__init__(...)​

Declare a new Entity.

Parameters

  • name (str) - Unique name for the new entity.

  • description (Optional[str]) - Short description of the new entity. Default: None

  • tags (Optional[Dict[str, str]]) - Tags associated with this Tecton Object (key-value pairs of arbitrary metadata). Default: None

  • owner (Optional[str]) - Owner name (typically the email of the primary maintainer). Default: None

  • prevent_destroy (bool) - If True, this Tecton object will be blocked from being deleted or re-created (i.e. a destructive update) during tecton plan/apply. To remove or update this object, prevent_destroy must be set to False via the same tecton apply or a separate tecton apply. prevent_destroy can be used to prevent accidental changes such as inadvertently deleting a Feature Service used in production or recreating a Feature View that triggers expensive rematerialization jobs. prevent_destroy also blocks changes to dependent Tecton objects that would trigger a recreate of the tagged object, e.g. if prevent_destroy is set on a Feature Service, that will also prevent deletions or re-creates of Feature Views used in that service. prevent_destroy is only enforced in live (i.e. non-dev) workspaces. Default: false

  • join_keys (Optional[List[Field]]) - Field objects corresponding to the entity's unique identifiers which will be used for aggregations Default: None

  • options (Optional[Dict[str, str]]) - Additional options to configure the Entity. Used for advanced use cases and beta features. Default: None


Raises

  • TectonValidationError: if the input non-parameters are invalid.

summary()​

Displays a human-readable summary.

validate()​

Method is deprecated and will be removed in a future version. As of Tecton version 1.0, objects are validated upon object creation, so validation is unnecessary.

Returns

None

Was this page helpful?