[Feature] Introduce typed Dataflow IR and an engine-neutral Arrow execution boundary #15

Closed
opened 2026-07-29 14:27:58 +02:00 by zemion · 1 comment
Owner

Parent: #1

Outcome

The graph editor, SQL workbench, node library, templates, and execution backends share one typed canonical intermediate representation instead of accumulating backend-specific behavior.

Scope

  • Define typed graph, port, schema, expression, parameter, operator, lineage, diagnostic, and result contracts with explicit versioning.
  • Separate node definitions, expression functions, composite/parameterized templates, planning/validation, and physical execution.
  • Use an Arrow-compatible tabular boundary so operators and backends exchange bounded typed batches rather than Python row dictionaries.
  • Preserve node/edge identity, coordinates, source fingerprints, semantic hashes, and loss diagnostics through supported graph/SQL round trips.
  • Add an execution-backend interface and a constrained isolated DuckDB worker as the first analytical backend.
  • Enforce row/byte/time/memory/concurrency budgets; arbitrary filesystem/network access, extensions, DDL/DML, and unchecked SQL remain disabled.
  • Keep the existing bounded reference executor for small deterministic tests and fallback.
  • Golden tests compare schemas, null/error semantics, ordering, aggregation, join/union behavior, diagnostics, and lineage across backends.

Parameterized template ownership remains in #12; this issue supplies the typed contracts it needs.

Parent: #1 ## Outcome The graph editor, SQL workbench, node library, templates, and execution backends share one typed canonical intermediate representation instead of accumulating backend-specific behavior. ## Scope - Define typed graph, port, schema, expression, parameter, operator, lineage, diagnostic, and result contracts with explicit versioning. - Separate node definitions, expression functions, composite/parameterized templates, planning/validation, and physical execution. - Use an Arrow-compatible tabular boundary so operators and backends exchange bounded typed batches rather than Python row dictionaries. - Preserve node/edge identity, coordinates, source fingerprints, semantic hashes, and loss diagnostics through supported graph/SQL round trips. - Add an execution-backend interface and a constrained isolated DuckDB worker as the first analytical backend. - Enforce row/byte/time/memory/concurrency budgets; arbitrary filesystem/network access, extensions, DDL/DML, and unchecked SQL remain disabled. - Keep the existing bounded reference executor for small deterministic tests and fallback. - Golden tests compare schemas, null/error semantics, ordering, aggregation, join/union behavior, diagnostics, and lineage across backends. Parameterized template ownership remains in #12; this issue supplies the typed contracts it needs.
Author
Owner

Codex State: done

Summary

  • Added versioned typed graph, port, schema, expression, parameter, lineage, diagnostic, physical-plan, and result contracts with stable semantic hashes and loss diagnostics.
  • Added bounded columnar batches with Arrow IPC plus an engine-neutral backend protocol, registry, concurrency slots, and deterministic reference fallback.
  • Added an optional isolated DuckDB analytical backend with generated-SELECT-only execution, disabled external access/extensions/persistent secrets/spill, locked configuration, and row/byte/time/memory/process limits.
  • Exposed reference, duckdb, and auto backend selection on preview requests and retained backend/version evidence on saved previews.
  • Golden tests compare aggregation, join, union, null/order behavior, schemas, diagnostics, and lineage across reference and DuckDB backends.

Changed Files

  • src/govoplan_dataflow/backend/ir.py
  • src/govoplan_dataflow/backend/planner.py
  • src/govoplan_dataflow/backend/batches.py
  • src/govoplan_dataflow/backend/backends
  • src/govoplan_dataflow/backend/service.py
  • src/govoplan_dataflow/backend/schemas.py
  • pyproject.toml
  • tests/test_typed_execution.py
  • tests/test_service.py

Verification

  • python -m unittest discover -s tests: 56 passed with analytics extra
  • ruff check src tests: passed
  • xenon --max-absolute C --max-modules B --max-average A src: passed
  • Core WebUI npm run build: passed
## Codex State: done ### Summary - Added versioned typed graph, port, schema, expression, parameter, lineage, diagnostic, physical-plan, and result contracts with stable semantic hashes and loss diagnostics. - Added bounded columnar batches with Arrow IPC plus an engine-neutral backend protocol, registry, concurrency slots, and deterministic reference fallback. - Added an optional isolated DuckDB analytical backend with generated-SELECT-only execution, disabled external access/extensions/persistent secrets/spill, locked configuration, and row/byte/time/memory/process limits. - Exposed reference, duckdb, and auto backend selection on preview requests and retained backend/version evidence on saved previews. - Golden tests compare aggregation, join, union, null/order behavior, schemas, diagnostics, and lineage across reference and DuckDB backends. ### Changed Files - `src/govoplan_dataflow/backend/ir.py` - `src/govoplan_dataflow/backend/planner.py` - `src/govoplan_dataflow/backend/batches.py` - `src/govoplan_dataflow/backend/backends` - `src/govoplan_dataflow/backend/service.py` - `src/govoplan_dataflow/backend/schemas.py` - `pyproject.toml` - `tests/test_typed_execution.py` - `tests/test_service.py` ### Verification - `python -m unittest discover -s tests: 56 passed with analytics extra` - `ruff check src tests: passed` - `xenon --max-absolute C --max-modules B --max-average A src: passed` - `Core WebUI npm run build: passed`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: GovOPlaN/govoplan-dataflow#15