Skip to main content

odcs.OdcsContract

An ODCS contract as read gives it.

Usage

Source

odcs.OdcsContract(
    document,
    tables=dict(),
    unread=list(),
)

Attributes

document: dict[str, Any]

The document as read.

tables: dict[str, list[Condition]]

The conditions sverify reads, per schema object, in the document’s order.

unread: list[Unread]
The rules sverify cannot read, with the reason.

Methods

Name Description
conditions() The conditions on schema object table (the only one by default),
schema() The columns of schema object table and their types: the

conditions()

The conditions on schema object table (the only one by default),

Usage

Source

conditions(table=None)

for requires={"orders": ...} or ensures=....

Parameters
table: str | None = None
The schema object’s name. Default: the contract’s only one.
Returns
list[Condition]

The conditions: SQL strings, sv.unique, sv.key,

sv.max_rows, sv.rows_per and sv.references.

schema()

The columns of schema object table and their types: the

Usage

Source

schema(table=None)

physical type where DuckDB reads it, else the logical type.

Parameters
table: str | None = None
The schema object’s name. Default: the contract’s only one.
Returns
ibis.Schema
An Ibis schema.