Skip to content

Add VALIDATION_OP=check_binds: bind-check a dbt test's compiled SQL - #60

Merged
carolsimone merged 1 commit into
mainfrom
feat/check-binds-op
Sep 8, 2026
Merged

Add VALIDATION_OP=check_binds: bind-check a dbt test's compiled SQL#60
carolsimone merged 1 commit into
mainfrom
feat/check-binds-op

Conversation

@carolsimone

Copy link
Copy Markdown
Owner

Summary

Adds a new validation op check_binds to the runner. It fetches the node's compiled SQL from S3 (CANDIDATE_SQL_URI, exactly like build_from_sql), calls adapter.check_binds(sql) — the engine's EXPLAIN, which parses and binds the read against the candidate schema without scanning rows — and creates nothing. Success exits 0 with the usual result block; a bind error (a dropped/renamed column or relation) surfaces the engine's error line through the same log/exit path as the build ops so the classifier sees it.

continuo's release-controller emits check_binds for every dbt test of a changed model, so a test whose SQL no longer binds against the shapes a release produces rejects that release at its source. This runtime release must ship (images published to ghcr) before continuo's PR pinning the tag merges — the executor emits check_binds only once that continuo PR is deployed, and a runtime without this op exits on the unknown op.

Changes

  • continuo_python_runtime/validation/runner.py: check_binds added to _NODE_OPS; the candidate-SQL-loading branch now covers both build_from_sql and check_binds; a dispatch branch calls adapter.check_binds(candidate_sql) and creates no table; module + main() docstrings updated.
  • tests/test_validation_runner.py: three tests mirroring the sibling build_from_sql tests (success asserts the adapter's recorded bind call with no build/clone/column-build; bind-error exit; empty-candidate-SQL exit), plus the two check_binds cases wired into the one-sentinel-block invariant table.
  • CHANGELOG.md: [Unreleased] Added entry.

Test plan

  • uv run pytest tests -k check_binds -v — the three new tests pass.
  • uv run pytest tests -v (non-Docker CI gate) — full suite green (the Docker image-smoke tests require a locally pre-built dev image and are unrelated).

🤖 Generated with Claude Code

https://claude.ai/code/session_01HmwnLzBDNG75NcYvX7w1gJ

EXPLAINs a dbt test's compiled SQL against the candidate schema via the
engine adapter and creates nothing, so a test naming a column a candidate
change dropped or renamed fails the release at its source instead of
being silently skipped or failing later, further from the cause.

check_binds joins _NODE_OPS and loads CANDIDATE_SQL_URI exactly as
build_from_sql does; the dispatch calls adapter.check_binds(candidate_sql)
after ensure_schema, building nothing.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HmwnLzBDNG75NcYvX7w1gJ
Signed-off-by: Simone Carolini <simonecarolini.sc@gmail.com>
@carolsimone carolsimone self-assigned this Sep 8, 2026
@carolsimone
carolsimone merged commit 4e7eedd into main Sep 8, 2026
13 checks passed
@carolsimone
carolsimone deleted the feat/check-binds-op branch September 8, 2026 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant