Skip to content

feat: target settings for Python nodes and providers, and statement summaries for sqb test - #1522

Merged
chio-labs-delivery[bot] merged 22 commits into
mainfrom
feat/target-settings-and-statement-summary
Nov 16, 2026
Merged

chio-labs-delivery[bot] merged 22 commits into
mainfrom
feat/target-settings-and-statement-summary

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Why

Python tasks, loaders, checks and providers could not see which target a command runs against. sqb test and sqb scenario test gave no view of how many warehouse statements a run issued or how long the warehouse spent compiling them.

Changes

  • Python nodes get ctx.target_config (a TargetSettings record) in build, check and load. loader_schema is None when the target schema uses ${CTX:...}.
  • Provider setup(ctx) gets ProviderSetupContext(target_config=...) in build, check and load. Event exporters and orchestration sensors and calendars still pass none; the providers page says so.
  • sqb test and sqb scenario test print a statement summary (counts by kind; on Snowflake, compile and execution time from query history) after the results, and add statements to --json. The history read uses its own connection with login, network and statement timeouts; interrupts propagate; other failures print "compile time unavailable".
  • Docs: Python nodes, providers, sqb test, scenarios; skill regenerated.
  • fensu: Python bindings +323 code lines across the sqlbuild-python crates (statement summary +153, target settings +170), capped at the measured size; the --since and statements JSON sections now share one helper.

Out of scope: a Python task or loader in sqb build with a ${CTX:...} target schema still tries to create the literal templated schema in the result store. Pre-existing on main; tracked separately.

Verification

  • DuckDB E2E for the statement summary and for target settings in build, check and load, including a CTX-templated schema and a provider setup probe: 189 targeted tests pass.
  • Rust unit tests for the progress projection and statement-timing SQL; clippy -D warnings; fensu clean.
  • make check-ci passes on the final head.

DuckShop: no edge case; a CTX-templated target schema and the provider setup context are target configuration and command behaviour, not a model, macro or data shape.

…hook contexts

Python side only; the native construction is not written yet.
At concurrency 1, an error that escapes a node's execution, such as a
worker report the control API rejects or a run cancellation raised from
the node-start report, stops the build. Above concurrency 1 the worker
wrapper turned the same error into a failed model result, so the build
went on starting later nodes, including after the server had rejected
the run's state.

Concurrent workers now pass the escaped error back to the scheduler,
which stops dispatching, lets the nodes already running finish, and
raises the error as the serial path does.
…ctly

The failure builder only forwarded its arguments, so passing the
dataclass keeps the runtime package within its code-line cap.
…loader contexts

Build, check and load resolve TargetSettings once from the target they
run against: database and schema as models resolve them, None with a
preserved flag for preserve, and the schema a managed source without its
own loads into.
TargetSettings is now a native record built from Rust values, so command
structs hold no new Python objects. debug, diff and load share one
effective_target_namespace that resolves the connection and adapter
defaults, replacing the keyword-built pyfunction each repeated.
…and-statement-summary

# Conflicts:
#	crates/sqlbuild-python/src/bindings/_helpers/build_command/command.rs
#	crates/sqlbuild-python/src/bindings/_helpers/build_command/lifecycle.rs
The pass/fail summary and failures are written and flushed first, so a slow
or interrupted warehouse history read cannot delay or hide them.
…nts sections

Both sqb test --json sections are now added by sqlbuild-core's json with_section.
The Python bindings cap follows the smaller crate.
@chio-labs-delivery
chio-labs-delivery Bot added this pull request to the merge queue Nov 16, 2026
Merged via the queue into main with commit 28e341a Nov 16, 2026
34 checks passed
@chio-labs-delivery
chio-labs-delivery Bot deleted the feat/target-settings-and-statement-summary branch November 16, 2026 20:13
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