Skip to main content

testing.source()

An in-memory source (sverify.io.StaticSource) holding rows.

Usage

Source

testing.source(
    rows,
    schema=None,
    *,
    name=None,
    version=0,
)

The sv_source fixture of sverify’s pytest plugin is this function.

Parameters

rows: Rows

The rows: an Arrow table, dicts by column name, or tuples in the schema’s column order.

schema: Any = None

The columns, as anything ibis.schema accepts (such as {"id": "!int64", "amount": "int64"}, where ! is NOT NULL), an Ibis schema or an Arrow schema. Optional for an Arrow table.

name: str | None = None

The table’s name in the plans that read it. Required (before 1.0 it defaulted to "table", which warns for one release).

version: int = 0
The source’s version. Default: 0.

Returns

StaticSource
A StaticSource.

Raises

TypeError
No schema is given for rows that are not an Arrow table.