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: trueAutofix is paused · Paused
|
4 tasks done
|
Autofix was enabled. Check current status in the Coding task. |
Signed-off-by: mday-io <mdaytn@gmail.com>
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 adds the query execution context provider and SQL comment transport.
PR #6174 adds automatic model context.
Why
Warehouse query history records SQLMesh's plan or run marker, but it cannot
connect each statement to the model evaluation reported by an execution
observer. Applications need to use one evaluation ID in both records.
How
Add an opt-in provider to engine adapters. It returns an immutable
QueryExecutionContext, which SQLMesh serializes as bounded, escaped version-oneJSON in a SQL comment. Keep the legacy marker first. Omit optional metadata on
ordinary provider or serialization failures and continue the query. Preserve
provider settings when adapters are cloned. Prevent provider settings from
leaking into cached DuckDB adapters or the default state adapter. Add a runnable
example that builds context from observer events.
Roll back adapter-owned transactions when a provider or driver raises a
BaseException, then propagate the original cancellation. This prevents a laterstatement from reusing an abandoned transaction.
The connection flag enables context comments. It does not infer model context.
An application provider must supply that context.
Test Plan
without transactions, and driver cancellation with query context disabled.
All 130 adjacent adapter and connection-pool tests passed.
expectations. These slow tests are outside
make fast-test.make stylepassed.make fast-testpassed all six phases. 2,983 passed and 13 skipped.make doc-testpassed. 29 passed.Context.plan(),Context.apply(), andContext.run(). Observer, materialization, and audit IDs matched for sixbatches. Hashes and rows were unchanged. Default state SQL had no rich context.
unavailable because MkDocs is not installed locally.
Checklist
make styleand fixed any issuesmake fast-test)git commit -s) per the DCO