Skip to content

refactor: call Rust-only planner functions directly and move selector tests to Rust - #1221

Merged
kvlonge merged 2 commits into
mainfrom
refactor/plan-crate
Oct 22, 2026
Merged

kvlonge merged 2 commits into
mainfrom
refactor/plan-crate

Conversation

@kvlonge

@kvlonge kvlonge commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Why

Many planner, plan-output, freshness, lifecycle and selection functions were registered on the native module only so Rust could call them or so Python tests could reach pure Rust logic. Each binding costs build time, stub surface and a module-attribute check, and keeps tests in Python for logic that lives in Rust.

Changes

  • 69 functions that only Rust calls lose their #[pyfunction] attributes, registrations, stub entries and module-attribute checks; Rust calls them directly. 11 had no caller at all and are removed.
  • Selector parsing, resolution, folder and table-function selection, error messages, SQLBuild model-selector names and unit-test selector splitting are tested in Rust over the sqlbuild-analysis functions that implement them. Every case the removed Python tests asserted is ported.
  • The Python tests of the removed bindings, their helpers and an empty test package are removed.
  • A dbt plan integration case covers a backslash path: selector through the real binding (folder, translation and exclusion of other folders).

No behaviour, output or diagnostics change.

Verification

  • Compiler differential 374/374; planner differential 11/11 against a recording on the base commit.
  • plan --json byte-identical on two large synthetic projects.
  • Runtime instruction counts at parity (dense compile, warm and cold plan); incremental native build 1.1% fewer instructions.
  • Focused Rust tests, about 2.2k focused Python unit, integration and e2e tests, workspace clippy -D warnings, fensu and make check-ci pass.

… through bindings

Planner, plan output, freshness, lifecycle and selection functions that
only Rust calls lose their `#[pyfunction]` attributes, registrations,
stub entries and the module-attribute checks that kept them registered;
Rust keeps calling them directly. Eleven of them had no caller at all
and are removed.

Selector parsing, resolution, model-selector names and unit-test
selector splitting are now tested in Rust over the analysis functions
that implement them, with every case the Python tests of the removed
bindings asserted; those Python tests and their helpers are removed.
@kvlonge
kvlonge enabled auto-merge (squash) October 22, 2026 19:24
@kvlonge
kvlonge merged commit 820d4b6 into main Oct 22, 2026
44 checks passed
@kvlonge
kvlonge deleted the refactor/plan-crate branch October 22, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant