Repository navigation
Conversation
Signed-off-by: mday-io <mdaytn@gmail.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
|
4 tasks done
Signed-off-by: mday-io <mdaytn@gmail.com>
Signed-off-by: mday-io <mdaytn@gmail.com>
Signed-off-by: mday-io <mdaytn@gmail.com>
mday-io
force-pushed
the
feat/automatic-query-execution-context
branch
from
October 31, 2026 23:30
6889176 to
b57bc31
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR depends on #6173. The branch includes the provider commit until #6173 merges.
This comparison
shows only the automatic-context changes.
Why
The provider in #6173 requires application code to connect warehouse statements
to model evaluations. A project configured through YAML needs SQLMesh to supply
that context automatically.
How
Use SQLMesh's native execution-observation hooks to create a context for each
model batch when a supported warehouse adapter has
query_execution_contextenabled and no custom provider. Nested audits reuse the batch's operation ID.
Expose the same immutable context to observer callbacks. Restore the worker's
previous context after completion or cancellation.
Forward each event to a configured console observer once. If no observer is
configured, automatic context still works.
observer_scope(None)disables thebuilt-in observer. SQL issued inside observer callbacks does not use automatic
model context. Custom providers remain authoritative, including when they return
None.The built-in observer covers model batches and nested audits during
Context.apply()and built-in scheduler runs. It does not add model context tostandalone operations or promise a detailed role for each SQL statement.
Test Plan
audit-only context and nested non-model or malformed-model context clearing.
make stylepassed.make fast-testpassed all six phases. 2,998 passed and 13 skipped.make doc-testpassed. 29 passed.Context.plan(),Context.apply(), andContext.run()in provider, automatic observer, and default console modes.IDs matched across six batches and audits. Observer IDs matched. Snapshot and
interval metadata matched. Hashes and rows were unchanged, and default state
SQL had no context.
passed.
build was unavailable because MkDocs is not installed locally.
Checklist
make styleand fixed any issuesmake fast-test)git commit -s) per the DCO