yera.runtime.blocks.table

Table block implementation.

Symbols

class TableStream — Stream handle for a table block that supports incremental row additions.

TableStream

Inherits: _StreamHandle

Stream handle for a table block that supports incremental row additions.

Returned by yr.table() to enable add_rows() functionality. Maintains table metadata (columns, border, block_id) and streams incremental row updates to the frontend. The frontend accumulates these rows to build the complete table state.

Methods

add_rows — Add rows to the table, matching Streamlit's element.add_rows() behavior.

TableStream.add_rows

add_rows(
    data: object,
) → None

Add rows to the table, matching Streamlit's element.add_rows() behavior.

The first call to an empty table fixes the column schema from the incoming data; later calls align to it.

Supports:

  • list of lists: each inner list is a row
  • list of dicts: each dict becomes a row (keys should match existing columns)
  • pandas DataFrame: adds all rows
  • single list: treated as a single row

TableStream.__enter__

__enter__()

TableStream.__exit__

__exit__(
    exc_type: type[BaseException] | None,
    exc_value: BaseException | None,
    traceback: TracebackType,
)