faust.windows

Window Types.

class faust.windows.Window(*args, **kwargs)[source]
class faust.windows.HoppingWindow(size: Union[datetime.timedelta, float, str], step: Union[datetime.timedelta, float, str], expires: Union[datetime.timedelta, float, str] = None) → None[source]

Hopping window type.

Fixed-size, overlapping windows.

ranges(timestamp: float) → List[Tuple[float, float]][source]
Return type:List[Tuple[float, float]]
stale(timestamp: float, latest_timestamp: float) → bool[source]
Return type:bool
current(timestamp: float) → Tuple[float, float][source]

The current WindowRange is the latest WindowRange for a given timestamp

Return type:Tuple[float, float]
delta(timestamp: float, d: Union[datetime.timedelta, float, str]) → Tuple[float, float][source]
Return type:Tuple[float, float]
earliest(timestamp: float) → Tuple[float, float][source]
Return type:Tuple[float, float]
class faust.windows.TumblingWindow(size: Union[datetime.timedelta, float, str], expires: Union[datetime.timedelta, float, str] = None) → None[source]

Tumbling window type.

Fixed-size, non-overlapping, gap-less windows.

class faust.windows.SlidingWindow(before: Union[datetime.timedelta, float, str], after: Union[datetime.timedelta, float, str], expires: Union[datetime.timedelta, float, str]) → None[source]

Sliding window type.

Fixed-size, overlapping windows that work on differences between record timestamps

ranges(timestamp: float) → List[Tuple[float, float]][source]

Return list of windows from timestamp.

Notes

SELECT * FROM s1, s2
WHERE
    s1.key = s2.key
AND
s1.ts - before <= s2.ts AND s2.ts <= s1.ts + after
Return type:List[Tuple[float, float]]
stale(timestamp: float, latest_timestamp: float) → bool[source]
Return type:bool