Aggregate
Summary​
TheAggregate class describes an aggregation feature that is applied to a Batch or Stream Feature View via features param.Example
from tecton import Aggregate, batch_feature_view, TimeWindowfrom tecton.types import Int64from datetime import timedelta@batch_feature_view(# ...features=[Aggregate(input_column=Field("my_column", Int64),function="mean",time_window=TimeWindow(window_size=timedelta(days=7)),),Aggregate(input_column=Field("another_column", Int64),function="mean",time_window=TimeWindow(window_size=timedelta(days=1)),name="1d_average",description="my aggregate feature description",tags={"tag": "value"}),],)def my_fv(data_source):pass
Methods​
__init__(...)​
Parameters
description(Optional[str]) - A human-readable description of the feature Default:Nonetags(Optional[Dict[str,str]]) - Tags associated with the feature (key-value pairs of user-defined metadata). Default:Nonefunction(AggregationFunction) - One of the built-in aggregation functions, such as "sum", "count",last(2)etc. Default:Nonetime_window(Union[TimeWindow,TimeWindowSeries,LifetimeWindow]) - The window_size and optional offset over which to aggregate over. Default:Nonename(Optional[str]) - The name of this feature. Defaults to an autogenerated name, e.g. transaction_count_7d_1d. Default:Noneinput_column(Field) - Describes name and type of the column that will be used in the aggregation. Default:None