Skip to content

API Reference parrot.semantic.accounting.runtime.duckdb

github-actions[bot] edited this page Dec 2, 2026 · 1 revision

parrot.semantic.accounting.runtime.duckdb

View source

DuckDB target for accounting queries (FEAT-713 M6).

The module is named duckdb; it never imports the duckdb package itself — DuckDB is reached only through the core DuckDBEngine.

Alias AccountingExecutionError

Re-exported from parrot.semantic.accounting.errors.AccountingExecutionError.

Alias AccountingModel

Re-exported from parrot.semantic.accounting.models.AccountingModel.

Alias CompiledMetricQuery

Re-exported from parrot.semantic.accounting.models.CompiledMetricQuery.

Alias DuckDBEngine

Re-exported from parrot.interfaces.duckdb_engine.DuckDBEngine.

Class DuckDBRuntime

Runs compiled accounting SQL over a provided frame on a shared DuckDBEngine.

Parameter Type Default Description
engine DuckDBEngine Shared core DuckDB engine.
frame_provider FrameProvider Awaitable callable resolving a frame name to a pandas / polars-like / Arrow frame.

Method DuckDBRuntime.execute

Fetch the model's frame, convert, run with a per-call registration, evaluate exactly.

execute(compiled: CompiledMetricQuery, model: AccountingModel) -> RuntimeResult

Parameter Type Default Description
compiled CompiledMetricQuery The compiled query; its SQL runs unchanged.
model AccountingModel The accounting model whose journal source names the frame.

Returns: RuntimeResult — Evaluated rows with exact Decimal amounts.

Raises:

  • AccountingExecutionError — no dataframe source, dialect not 'duckdb', conversion or execution failure.

Alias FrameConversionError

Re-exported from parrot.interfaces.duckdb_engine.FrameConversionError.

Attribute FrameProvider

Alias MetricPlan

Re-exported from parrot.semantic.accounting.models.MetricPlan.

Alias RuntimeResult

Re-exported from parrot.semantic.accounting.models.RuntimeResult.

Alias evaluate_rows

Re-exported from parrot.semantic.accounting.evaluation.evaluate_rows.

Function output_columns

Result columns in plan order: bucket (when grained), the dimensions, then the plan output names.

output_columns(plan: MetricPlan) -> tuple[str, ...]

Parameter Type Default Description
plan MetricPlan The compiled metric plan.

Returns: tuple[str, ...] — The ordered column names.

Alias to_arrow

Re-exported from parrot.interfaces.duckdb_engine.to_arrow.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally