tecton.interactive.FeatureTable

class tecton.interactive.FeatureTable(proto)

FeatureTable class.

To get a FeatureTable instance, call tecton.get_feature_table().

Methods

get_feature_vector

Returns a single Tecton FeatureVector from the Online Store.

get_features

Gets all features that are defined by this FeatureTable.

get_historical_features

Returns a Tecton DataFrame of historical values for this feature table.

get_online_features

Returns a single Tecton FeatureVector from the Online Store.

ingest

Ingests a Dataframe into the FeatureTable.

materialization_status

Displays materialization information for the FeatureTable, which may include past jobs, scheduled jobs, and job failures.

preview

Shows a preview of the FeatureTable’s features.

summary

Returns various information about this feature definition, including the most critical metadata such as the name, owner, features, etc.

timestamp_key

Returns the timestamp_key column name of this FeatureTable.

get_feature_vector(join_keys=None, include_join_keys_in_response=False)

Returns a single Tecton FeatureVector from the Online Store.

Parameters
  • join_keys (Optional[Mapping[str, Union[int, int64, str, bytes]]]) – Join keys of the enclosed FeatureTable.

  • include_join_keys_in_response (bool) – Whether to include join keys as part of the response FeatureVector.

Returns

A FeatureVector of the results.

get_features(entities=None, start_time=None, end_time=None)

Gets all features that are defined by this FeatureTable.

Parameters
  • entities (Union[DataFrame, DataFrame, None]) – (Optional) A DataFrame that is used to filter down feature values. If specified, this DataFrame should only contain join key columns.

  • start_time (Union[DateTime, datetime, None]) – (Optional) The interval start time from when we want to retrieve features.

  • end_time (Union[DateTime, datetime, None]) – (Optional) The interval end time until when we want to retrieve features.

Returns

A Tecton DataFrame with features values.

get_historical_features(spine=None, timestamp_key=None, entities=None, start_time=None, end_time=None, save=False, save_as=None)

Returns a Tecton DataFrame of historical values for this feature table. Either provide a spine to join against or set parameters start_time, end_time, and/or entities to specify which values to return.

Parameters
  • spine (Union[DataFrame, DataFrame, DataFrame, None]) –

    (Optional) The spine to join against, as a dataframe.

    If present, the returned DataFrame will contain rollups for all (join key, temporal key) combinations that are required to compute a full frame from the spine.

    To distinguish between spine columns and feature columns, feature columns are labeled as

    feature_view_name.feature_name in the returned DataFrame. If spine is not specified, it’ll return a DataFrame of feature values in the specified time range.

  • timestamp_key (Optional[str]) – (Optional) Name of the time column in spine. If unspecified, will default to the time column of the spine if there is only one present.

  • entities (Union[DataFrame, DataFrame, DataFrame, None]) – (Optional) A DataFrame that is used to filter down feature values. If specified, this DataFrame should only contain join key columns.

  • start_time (Union[DateTime, datetime, None]) – (Optional) The interval start time from when we want to retrieve features. If no timezone is specified, will default to using UTC.

  • end_time (Union[DateTime, datetime, None]) – (Optional) The interval end time until when we want to retrieve features. If no timezone is specified, will default to using UTC.

  • save (bool) – (Optional) set to True to persist DataFrame as a Dataset object. Default is False.

  • save_as (Optional[str]) – (Optional) name to save the DataFrame as. If unspecified and save=True, a name will be generated.

Returns

A Tecton DataFrame with features values.

get_online_features(join_keys, include_join_keys_in_response=False)

Returns a single Tecton FeatureVector from the Online Store.

Parameters
  • join_keys (Mapping[str, Union[int, int64, str, bytes]]) – Join keys of the enclosed FeatureTable.

  • include_join_keys_in_response (bool) – Whether to include join keys as part of the response FeatureVector.

Returns

A FeatureVector of the results.

ingest(df)

Ingests a Dataframe into the FeatureTable.

Parameters

df (Union[DataFrame, DataFrame]) – The Dataframe to be ingested. Has to conform to the FeatureTable schema.

materialization_status(verbose=False, limit=1000, sort_columns=None, errors_only=False)

Displays materialization information for the FeatureTable, which may include past jobs, scheduled jobs, and job failures.

Parameters
  • verbose – If set to true, method will display additional low level materialization information, useful for debugging.

  • limit – Maximum number of jobs to return.

  • sort_columns – A comma-separated list of column names by which to sort the rows.

Param

errors_only: If set to true, method will only return jobs that failed with an error.

preview(limit=10, time_range=None)

Shows a preview of the FeatureTable’s features. Random, unique join_keys are chosen to showcase the features.

Parameters
  • limit – (Optional, default=10) The number of rows to preview.

  • time_range (Optional[Period]) – (Optional) Time range to collect features from. Will default to recent data (past 2 days).

Returns

A Tecton DataFrame.

summary()

Returns various information about this feature definition, including the most critical metadata such as the name, owner, features, etc.

timestamp_key()

Returns the timestamp_key column name of this FeatureTable.

Attributes

created_at

Returns the creation date of this Tecton Object.

defined_in

Returns filename where this Tecton Object has been declared.

description

The description of this Tecton Object, set by user.

entity_names

Returns a list of entity names.

family

The family of this Tecton Object, used to group Objects.

features

Returns the names of the (output) features.

id

Returns the id of this object

join_keys

Returns the join key column names

name

The name of this Tecton Object.

online_serving_index

Returns Defines the set of join keys that will be indexed and queryable during online serving.

owner

The owner of this Tecton Object (typically the email of the primary maintainer.)

tags

Tags associated with this Tecton Object (key-value pairs of arbitrary metadata set by user.)

type

Returns the FeatureTable type.

url

Returns a link to the Tecton Web UI.

wildcard_join_key

Returns a wildcard join key column name if it exists; Otherwise returns None.

workspace

Returns the workspace this Tecton Object was created in.