Repository navigation
refactor(native): read planner audits, functions, seeds and sources through native views - #1215
Merged
Merged
Conversation
`audit_reads` returns each audit attribute the planner reads from the native audit view, built exactly as its Python attribute is, and counts any other object in `compiled_view_fallbacks` before reading it by attribute. Audit plan entries, audit attachment, relation scopes and source deferral read audits through it. The fallback test now also plans the waffle shop fixture, whose sources, seeds, functions and audits are all read natively.
…cessor `function_reads` returns each function attribute the planner reads from the native function view, built exactly as its Python attribute is, and counts any other object in `compiled_view_fallbacks`. Function plan entries, identity hashes, relation locations and clone plans read functions through it.
…elds natively `seed_reads` and `source_reads` return the seed and source attributes the planner reads from their native views, and `resource_reads` reads a name, key, dependency keys, destination, schema entry or references from whichever native view a resource is. Each counts any other object in `compiled_view_fallbacks`. Seed, source, scenario, clone, command, identity, scope and warehouse planning read through them; seed plan entries keep reading their own attributes.
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.
Why
The planner read compiled audits, functions, seeds and sources by generic attribute lookup. That hides which native view each read depends on and blocks moving planning onto plain Rust records. Models already go through one counted native accessor. This applies the same treatment to the other resource kinds.
Changes
audit_reads,function_reads,seed_readsandsource_readsreturn each attribute the planner reads from that kind's native view, built exactly as its Python attribute is. Any other object is counted in thecompiled_view_fallbacksstage counter and then read by attribute.resource_readshandlesname,key,deps,destination,schema_entryandreferencesfor sites that read every resource kind alike.No behaviour, output, diagnostics or API changes.
Verification
compileandplanon those projects and on waffle shop.sqb plan) are at parity, within ±0.2%.-D warningsandmake check-ci.