Skip to main content

Node.to_substrait()

The node’s verified plan for any conforming Substrait consumer,

Usage

Source

Node.to_substrait(
    format="json",
    *,
    shims="apply",
)

with its contract as metadata: Report.to_substrait of report.

The plan is the last transform’s: it reads a contracted node upstream as a table under that transform’s name, and the contract’s requires on it are what that node guarantees. Export each node of a pipeline for the whole of it. internal_plan is the fused stage in sverify’s internal form.

Parameters

format: Literal["json", "binary"] = "json"

"json" (protobuf JSON, a string) or "binary" (the serialized substrait.Plan).

shims: Literal["apply", "annotate", "refuse"] = "apply"
What to do at a spec gap the proof depends on (see Report.to_substrait).

Returns

str | bytes
The plan, as protobuf JSON or bytes.

Raises

sverify.errors.ExportError
The node has no contract (a source, or a plain function’s node), its report is not proved, or the plan has no conforming Substrait form that keeps the proof.