faust.types.tables

class faust.types.tables.CollectionT(app: _AppT, *, name: Optional[str] = None, default: Optional[Callable[[], Any]] = None, store: Optional[Union[str, URL]] = None, schema: Optional[_SchemaT] = None, key_type: Optional[_ModelArg] = None, value_type: Optional[_ModelArg] = None, partitions: Optional[int] = None, window: Optional[WindowT] = None, changelog_topic: Optional[TopicT] = None, help: Optional[str] = None, on_recover: Optional[Callable[[], Awaitable[None]]] = None, on_changelog_event: Optional[Callable[[EventT], Awaitable[None]]] = None, recovery_buffer_size: int = 1000, standby_buffer_size: Optional[int] = None, extra_topic_configs: Optional[Mapping[str, Any]] = None, options: Optional[Mapping[str, Any]] = None, use_partitioner: bool = False, on_window_close: Optional[Callable[[Any, Any], Union[None, Awaitable[None]]]] = None, **kwargs: Any)[source]
app: _AppT
name: str
default: Any
schema: Optional[_SchemaT]
key_type: Optional[_ModelArg]
value_type: Optional[_ModelArg]
partitions: Optional[int]
window: Optional[WindowT]
help: str
recovery_buffer_size: int
standby_buffer_size: int
options: Optional[Mapping[str, Any]]
last_closed_window: float
use_partitioner: bool
is_global: bool = False
abstract clone(**kwargs: Any) Any[source]
Return type:

Any

abstract property changelog_topic: TopicT
Return type:

TopicT

abstract apply_changelog_batch(batch: Iterable[EventT]) None[source]
Return type:

None

abstract persisted_offset(tp: TP) Optional[int][source]
Return type:

_UnionGenericAlias[int, None]

abstract async need_active_standby_for(tp: TP) bool[source]
Return type:

bool

abstract reset_state() None[source]
Return type:

None

abstract send_changelog(partition: Optional[int], key: Any, value: Any, key_serializer: Optional[Union[CodecT, str]] = None, value_serializer: Optional[Union[CodecT, str]] = None) FutureMessage[source]
Return type:

FutureMessage

abstract partition_for_key(key: Any) Optional[int][source]
Return type:

_UnionGenericAlias[int, None]

abstract async on_window_close(key: Any, value: Any) None[source]
Return type:

None

abstract async on_rebalance(assigned: Set[TP], revoked: Set[TP], newly_assigned: Set[TP], generation_id: int = 0) None[source]
Return type:

None

abstract async on_changelog_event(event: EventT) None[source]
Return type:

None

abstract on_recover(fun: Callable[[], Awaitable[None]]) Callable[[], Awaitable[None]][source]
Return type:

_CallableGenericAlias[_GenericAlias[None]]

abstract async on_recovery_completed(active_tps: Set[TP], standby_tps: Set[TP]) None[source]
Return type:

None

abstract async call_recover_callbacks() None[source]
Return type:

None

abstract using_window(window: WindowT, *, key_index: bool = False) WindowWrapperT[source]
Return type:

WindowWrapperT

abstract hopping(size: Union[timedelta, float, str], step: Union[timedelta, float, str], expires: Optional[Union[timedelta, float, str]] = None, key_index: bool = False) WindowWrapperT[source]
Return type:

WindowWrapperT

abstract tumbling(size: Union[timedelta, float, str], expires: Optional[Union[timedelta, float, str]] = None, key_index: bool = False) WindowWrapperT[source]
Return type:

WindowWrapperT

abstract as_ansitable(**kwargs: Any) str[source]
Return type:

str

Diag: Type[DiagT]
diag: DiagT
async_exit_stack: AsyncExitStack
exit_stack: ExitStack
shutdown_timeout: float
class faust.types.tables.TableT(app: _AppT, *, name: Optional[str] = None, default: Optional[Callable[[], Any]] = None, store: Optional[Union[str, URL]] = None, schema: Optional[_SchemaT] = None, key_type: Optional[_ModelArg] = None, value_type: Optional[_ModelArg] = None, partitions: Optional[int] = None, window: Optional[WindowT] = None, changelog_topic: Optional[TopicT] = None, help: Optional[str] = None, on_recover: Optional[Callable[[], Awaitable[None]]] = None, on_changelog_event: Optional[Callable[[EventT], Awaitable[None]]] = None, recovery_buffer_size: int = 1000, standby_buffer_size: Optional[int] = None, extra_topic_configs: Optional[Mapping[str, Any]] = None, options: Optional[Mapping[str, Any]] = None, use_partitioner: bool = False, on_window_close: Optional[Callable[[Any, Any], Union[None, Awaitable[None]]]] = None, **kwargs: Any)[source]
class faust.types.tables.GlobalTableT(app: _AppT, *, name: Optional[str] = None, default: Optional[Callable[[], Any]] = None, store: Optional[Union[str, URL]] = None, schema: Optional[_SchemaT] = None, key_type: Optional[_ModelArg] = None, value_type: Optional[_ModelArg] = None, partitions: Optional[int] = None, window: Optional[WindowT] = None, changelog_topic: Optional[TopicT] = None, help: Optional[str] = None, on_recover: Optional[Callable[[], Awaitable[None]]] = None, on_changelog_event: Optional[Callable[[EventT], Awaitable[None]]] = None, recovery_buffer_size: int = 1000, standby_buffer_size: Optional[int] = None, extra_topic_configs: Optional[Mapping[str, Any]] = None, options: Optional[Mapping[str, Any]] = None, use_partitioner: bool = False, on_window_close: Optional[Callable[[Any, Any], Union[None, Awaitable[None]]]] = None, **kwargs: Any)[source]
class faust.types.tables.TableManagerT(app: _AppT, **kwargs: Any)[source]
app: _AppT
actives_ready: bool
standbys_ready: bool
abstract add(table: CollectionT) CollectionT[source]
Return type:

CollectionT

abstract persist_offset_on_commit(store: StoreT, tp: TP, offset: int) None[source]
Return type:

None

abstract on_commit(offsets: MutableMapping[TP, int]) None[source]
Return type:

None

abstract async on_rebalance(assigned: Set[TP], revoked: Set[TP], newly_assigned: Set[TP], generation_id: int = 0) None[source]
Return type:

None

abstract on_partitions_revoked(revoked: Set[TP]) None[source]
Return type:

None

abstract on_rebalance_start() None[source]
Return type:

None

abstract async wait_until_tables_registered() None[source]
Return type:

None

abstract async wait_until_recovery_completed() bool[source]
Return type:

bool

abstract property changelog_topics: Set[str]
Return type:

_GenericAlias[str]

Diag: Type[DiagT]
diag: DiagT
async_exit_stack: AsyncExitStack
exit_stack: ExitStack
shutdown_timeout: float
data: MutableMapping[KT, VT]
class faust.types.tables.WindowSetT(key: KT, table: TableT, wrapper: WindowWrapperT, event: Optional[EventT] = None)[source]
key: Any
table: TableT
event: Optional[EventT]
abstract apply(op: Callable[[VT, VT], VT], value: VT, event: Optional[EventT] = None) WindowSetT[source]
Return type:

WindowSetT

abstract value(event: Optional[EventT] = None) VT[source]
Return type:

~VT

abstract current(event: Optional[EventT] = None) VT[source]
Return type:

~VT

abstract now() VT[source]
Return type:

~VT

abstract delta(d: Union[timedelta, float, str], event: Optional[EventT] = None) VT[source]
Return type:

~VT

class faust.types.tables.WindowedItemsViewT(mapping: WindowWrapperT, event: Optional[EventT] = None)[source]
abstract now() Iterator[Tuple[Any, Any]][source]
Return type:

_GenericAlias[_GenericAlias[Any, Any]]

abstract current(event: Optional[EventT] = None) Iterator[Tuple[Any, Any]][source]
Return type:

_GenericAlias[_GenericAlias[Any, Any]]

abstract delta(d: Union[timedelta, float, str], event: Optional[EventT] = None) Iterator[Tuple[Any, Any]][source]
Return type:

_GenericAlias[_GenericAlias[Any, Any]]

class faust.types.tables.WindowedValuesViewT(mapping: WindowWrapperT, event: Optional[EventT] = None)[source]
abstract now() Iterator[Any][source]
Return type:

_GenericAlias[Any]

abstract current(event: Optional[EventT] = None) Iterator[Any][source]
Return type:

_GenericAlias[Any]

abstract delta(d: Union[timedelta, float, str], event: Optional[EventT] = None) Iterator[Any][source]
Return type:

_GenericAlias[Any]

class faust.types.tables.WindowWrapperT(table: TableT, *, relative_to: Optional[Union[_FieldDescriptorT, Callable[[Optional[EventT]], Union[float, datetime]], datetime, float]] = None, key_index: bool = False, key_index_table: Optional[TableT] = None)[source]
table: TableT
abstract property name: str
Return type:

str

abstract clone(relative_to: Optional[Union[_FieldDescriptorT, Callable[[Optional[EventT]], Union[float, datetime]], datetime, float]]) WindowWrapperT[source]
Return type:

WindowWrapperT

abstract relative_to_now() WindowWrapperT[source]
Return type:

WindowWrapperT

abstract relative_to_field(field: _FieldDescriptorT) WindowWrapperT[source]
Return type:

WindowWrapperT

abstract relative_to_stream() WindowWrapperT[source]
Return type:

WindowWrapperT

abstract get_timestamp(event: Optional[EventT] = None) float[source]
Return type:

float

abstract keys() a set-like object providing a view on D's keys[source]
Return type:

_SpecialGenericAlias

abstract on_set_key(key: Any, value: Any) None[source]
Return type:

None

abstract on_del_key(key: Any) None[source]
Return type:

None

abstract as_ansitable(**kwargs: Any) str[source]
Return type:

str

property get_relative_timestamp: Optional[Callable[[Optional[EventT]], Union[float, datetime]]]
Return type:

_UnionGenericAlias[_CallableGenericAlias[_UnionGenericAlias[EventT, None], _UnionGenericAlias[float, datetime]], None]