Skip to content

yggdrasil.plan.operation_result

operation_result

Operation metadata returned by INSERT / UPDATE / MERGE / DELETE plans.

The :class:SelectPlan side hands back a :class:Tabular (the read result). The write-side plans (:class:InsertPlan, :class:MergePlan, …) hand back an :class:OperationResult — a small frozen record describing what changed: rows inserted, updated, deleted, and the post-write target Tabular for downstream chaining.

OperationResult dataclass

OperationResult(
    operation: str,
    rows_inserted: int = 0,
    rows_updated: int = 0,
    rows_deleted: int = 0,
    target: "Tabular | None" = None,
)

Metadata for a write-side plan execution.

to_arrow_tabular

to_arrow_tabular() -> 'Tabular'

Materialise this result as a single-row Arrow Tabular.

Used by :class:ExecutionPlan's :class:Tabular contract: write_plan.read_arrow_table() yields the metadata row instead of the post-write data.