Skip to content

Interfaces

rerun

class AsComponents

Bases: Protocol

Describes interface for interpreting an object as a bundle of Components.

Note: the num_instances() function is an optional part of this interface. The method does not need to be implemented as it is only used after checking for its existence. (There is unfortunately no way to express this correctly with the Python typing system, see https://github.com/python/typing/issues/601).

def as_component_batches()

Returns an iterable of ComponentBatchLike objects.

Each object in the iterable must adhere to the ComponentBatchLike interface.

class ComponentBatchLike

Bases: Protocol

Describes interface for objects that can be converted to batch of rerun Components.

def as_arrow_array()

Returns a pyarrow.Array of the component data.

def component_descriptor()

Returns the complete descriptor of the component.

class ComponentColumn

A column of components that can be sent using send_columns.

This is represented by a ComponentBatch array that has been repartitioned into multiple segments. This is useful for reinterpreting a single contiguous batch as multiple sub-batches to use with the send_columns API.

def __init__(component_batch, lengths)

Construct a new component column.

PARAMETER DESCRIPTION
component_batch

The component batch to partition into a column.

TYPE: ComponentBatchLike

lengths

The lengths of the partitions.

TYPE: ArrayLike

def as_arrow_array()

The component as an arrow batch.

Part of the ComponentBatchLike logging interface.

def component_descriptor()

Returns the complete descriptor of the component.

Part of the ComponentBatchLike logging interface.