Feat: Support gateway in model defaults - #5962
Open
josephfinlayson wants to merge 3 commits into
Open
Conversation
Signed-off-by: Joseph Finlayson <joseph.finlayson@gmail.com>
josephfinlayson
marked this pull request as ready for review
August 20, 2026 23:29
Signed-off-by: Joseph Finlayson <joseph.finlayson@gmail.com>
4 tasks
Collaborator
|
Looks good to me, let me fix the jobs and see if anything comes up. I have a PR to fix the failing dbt test and the other python tests should succeed on retries (found a UTC boundary bug in there). Once all the CI jobs are green I'll merge. |
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
Multi-project contexts can already load models from independently configured projects into one graph and shared state store. However, a model without an explicit
gatewaycurrently inherits the one context-selected gateway, so every model in a secondary project must repeat the samegatewayproperty.This adds
model_defaults.gatewayas a project-level default for managed SQL, Python, and seed models:The default is resolved before model name qualification, so the model receives the selected gateway's default catalog and gateway variables. An explicit
gatewayin a SQLMODELblock or Python decorator still takes precedence.Plain Python decorator gateway strings are treated as literal gateway names, including names with characters such as hyphens. Macro-prefixed Python gateway values retain blueprint rendering, as do SQL
MODELgateway expressions.External models intentionally remain gateway-neutral unless their YAML row specifies a gateway. For external models, gateway selects an alternate source definition rather than an execution default.
No behavior changes when
model_defaults.gatewayis omitted.Prior art
This builds on:
models/directory #4996, which discusses broader default scoping but not project-level gateway routing.Test plan
make stylemake fast-test(2,777 passed across the fast, isolated, registry-isolation, and dialect-isolation phases)Checklist
make styleand fixed any issues.make fast-test).