Skip to content

feat(native): report model config errors natively - #1042

Merged
kvlonge merged 2 commits into
mainfrom
feat/native-model-config-errors
Oct 8, 2026
Merged

kvlonge merged 2 commits into
mainfrom
feat/native-model-config-errors

Conversation

@kvlonge

@kvlonge kvlonge commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Why

The preview engine re-ran Python whenever a native model config stage failed, only to get the exact error. That kept a Python fallback on every error path and could run user macros twice. Native stages now report Python's exact errors themselves.

Changes

  • Native config build, model validators, MODEL header columns/audits, ${...} templates and path-default selection return the error Python raises: same class, code, message and help, in the same order. Errors from stages that never read SQL (config build, templates, header metadata, path defaults) raise as CompileInputError(..., bridge_independent=True). Validator errors are not marked, because some read macro-expanded SQL; the macro bridge decides whether to re-run them. Other errors raise as ResourceIdentityError, DiscoveryConflictError or ConfigValueTypeError where Python uses those.
  • Removed the NativeStageMismatchError paths for header metadata and templates, the path-default re-run, and the validator re-run on errors. The Python validators now run only when native defers.
  • Native still defers inputs that need Python's exact rules: non-ASCII or unreadable text, very large integers, unusual ISO timestamp forms, sub-second cursor-bound ordering, Decimal special forms, dbt references, audit thresholds, non-string metadata keys and unhashable values.

Verification

  • Parity tests against Python with generated multi-fault configs (validators and builds); new failure-corpus cases for templates, header metadata, references and several faults; and an E2E test showing preview errors match Python with no Python fallback and macros run once; a reference error from macro SQL is re-run by the bridge.
  • cargo test, clippy/fmt on 1.99.0, make check-ci, make test, both compiler differentials with coverage, and the differential E2E suite.

@kvlonge
kvlonge enabled auto-merge (squash) October 8, 2026 19:37
@kvlonge
kvlonge force-pushed the feat/native-model-config-errors branch from 3af9388 to bf0bfb5 Compare October 8, 2026 20:35
@kvlonge
kvlonge merged commit 19ae79e into main Oct 8, 2026
37 checks passed
@kvlonge
kvlonge deleted the feat/native-model-config-errors branch October 8, 2026 21:34
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