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 Entityfrom tecton.types import Field, Stringcustomer = 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​
Name | Data Type | Description |
---|---|---|
created_at | Optional[datetime.datetime] | Returns the time that this Tecton object was created or last updated. None for locally defined objects. |
defined_in | Optional[str] | The repo filename where this object was declared. None for locally defined objects. |
description | Optional[str] | Returns the description of the Tecton object. |
id | str | Returns the unique id of the Tecton object. |
info | ||
join_keys | List[str] | Join keys of the entity. |
name | str | Returns the name of the Tecton object. |
owner | Optional[str] | Returns the owner of the Tecton object. |
prevent_destroy | bool | Return whether entity has prevent_destroy flagged |
tags | Dict[str, str] | Returns the tags of the Tecton object. |
workspace | Optional[str] | Returns the workspace that this Tecton object belongs to. None for locally defined objects. |
Methods​
Name | Description |
---|---|
__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. ifprevent_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