Repository navigation
Commit afd1df1
authored
refactor: call compile driver and planner stages directly and host CompiledResourceType natively (#1124)
* refactor(planner): call the last planner helpers directly and count planner work natively
Planning, migration fingerprints, identities, SQL-test planning and table
types no longer go through _native module lookups. Tests that replaced
those functions now observe native work counters (planner_identity_work_info,
migration_fingerprint_work_info), drive planning through project and
adapter inputs, or inject table-type drift at the executor hand-off.
Freshness errors, cost scopes, progress reporters and the event writer are
constructed directly. SQL-test planning and chain requests are Rust
structs; their records and pyfunctions are removed.
* refactor(graph): hold the project graph natively and hash Python-node identities at discovery
ProjectGraph is a native class over the compiled project and its native
lineage graph; selection, DAG and Python run-selection readers use it
without attribute lookups. Planner scope, loader and static command
phases call their native helpers directly. Discovered Python nodes carry
their identity, hashed once by the user-code host at discovery; graphs
built from hand-made records still hash on demand.
* refactor(compile): apply target defaults and build lineage rows from native views
Native models, seeds and functions take adapter target defaults through
direct Rust calls instead of Python method dispatch. The project lineage
graph reads source, seed and function rows from their native records.
Removes NativeAttr ids that no Rust code or pure-Rust crate names.
* refactor(compile): call discovery, configuration and assembly stages directly and count stage work natively
Discovery, model configuration and the lane A compile driver files
(assembly*, project, discovery, inputs, config_validation) now call the
native stage functions directly instead of looking them up on the
sqlbuild._native module. Tests that spied on those module attributes
read compile_stage_work_info counters (SQL test assembly, pivot proofs,
declaration scopes, promotion conflicts, lineage graph builds) or the
stage's own answers instead.
Removed: the externally_described_models pyfunction (no Python caller),
30 unused NativeAttr ids, the header worker-pool error test and the
unretained-model-facts test (both needed a replaced module function to
reach an internal invariant).
* refactor(compile): read declared relations and known declarations natively during analysis setup
assembly_analysis builds the declared relations, known function names and
known declared types with direct Rust calls. The declared_relations,
known_function_names and known_declared_types pyfunctions had no Python
callers and are removed with their stubs and NativeAttr ids.
* refactor(compile): run model analysis, expression shapes and semantic completion as direct calls
Assembly calls the three analysis stages in Rust. Stage tests take the
stage inputs from the test-support assembly_stage_inputs(stage, ...),
which assembles like assemble_project and stops before the stage, and
read stage counts from compile_stage_work_info (including expression
shape batches). Removes the invariant-only test that replaced model
analysis with an empty result.
* refactor(compile): call the compile driver stages and project discovery directly from commands
compile_driver analysis, pipeline, command and phases call lineage, graph
selection, unit-test selector checks, adapter-name resolution, contracts,
rules, connection config, manifest and reuse-store stages in Rust, and
every command calls discover_project_inputs / build_compiled_project
directly. Tests that replaced those module attributes now use stage
counters (project discoveries, lineage, contracts), a failing provider
module, adapter hooks on a manual clock, or a PreparedCompileArtifacts
subclass; the compile case of the injected rich-lineage panic test is
dropped because compile no longer reads the module attribute.
* refactor(compile): host CompiledResourceType as a native string enum
CompiledResourceType is registered with the native string enums in
sqlbuild._native (same members, values, str, repr and StrEnum behaviour)
instead of being defined in sqlbuild.compiler.compile.types. Rust reads it
through the record registry rather than importing the Python module or
the facade host entry; Python importers take it from sqlbuild._native.
Stage captures keep its previous qualified name through the hosted shape
table, so captures are unchanged.
* refactor: read native record fields directly in the compile driver and merge lane updates
* fix: keep Ctrl-C raised while releasing freed memory after rules, and make the compile interrupt test deterministic
* fix: report SQL test planning panics as native compiler errors1 parent bbcfd7a commit afd1df1
305 files changed
Lines changed: 3366 additions & 3256 deletions
File tree
- crates
- sqlbuild-cache/src/hosted_shapes
- sqlbuild-python/src/bindings/_helpers
- analysis_session
- analysis
- build_command
- check
- cli
- clone
- command_runtime
- compile_attachment
- compile_driver
- compile_records
- compiled_project
- compiler_enums
- compiler_records
- contract_command
- contracts
- cost_command
- cost_telemetry
- dag_artifact
- dbt_interop
- debug_command
- diagnostics
- diff_report
- discovery
- execution_history
- format_command
- freshness
- graph
- hand_built
- janitor
- lineage
- load
- model_config
- native_host
- plan_command
- planner_changes
- planner_entries
- planner_identity
- planner_migrations
- planner_phases
- planner_scenario
- planner_scope
- planner_selection
- planner_strategy
- planner_warehouse
- project_assembly
- query_command
- record_behaviours
- records
- refactor
- render
- result_output
- rules
- scenario_command
- scopes
- semantic_checks
- semantic_shapes
- sql_test_glue
- sqltext
- scripts/cold_compile_performance/_helpers
- src/sqlbuild
- compiler/compile
- executor/build
- _helpers
- classes
- tests
- e2e/src/sqlbuild/cli/commands/main/compile
- fast_lineage
- integration/src/sqlbuild
- cli/commands/main
- model_migrations
- compiler
- analysis_session
- compiled_project
- graph
- pipeline
- planner
- _helpers
- fixtures
- resolve
- sql_test_assembly
- main
- semantic_checks
- sql_test_glue
- executor
- build
- concurrent
- custom
- run
- incremental
- microbatch
- view
- scenario
- testing
- unit/src/sqlbuild
- cli
- commands
- _helpers
- build_planning
- cost
- main
- build
- compile
- execution
- output/main/plan
- progress/classes
- compiler
- auditing/main
- compile/_helpers
- contract_adoption/_helpers
- contracts
- dag/main
- discovery/_helpers
- lineage
- manifest
- pipeline
- _helpers
- target_validation
- main
- planner
- _helpers
- changes
- migrations
- planning
- resolve
- sql_test_assembly
- warehouse
- classes
- main
- execution
- identity
- python_nodes/_helpers
- source_freshness/main
- executor
- auditing/main
- build
- _helpers
- classes
- clone/_helpers
- fingerprinting
- janitor/main
- pipeline
- _helpers
- main
- run/_helpers
- scenario
- _helpers
- main
- seed/main
- testing/main
- integrations/dbt
- lint
- rule_engine
- _helpers/engine
- classes/audit_facts
- main/evaluate
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
446 | 446 | | |
447 | 447 | | |
448 | 448 | | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
449 | 453 | | |
450 | 454 | | |
451 | 455 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
| |||
105 | 108 | | |
106 | 109 | | |
107 | 110 | | |
108 | | - | |
109 | | - | |
110 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
111 | 121 | | |
112 | 122 | | |
113 | 123 | | |
| |||
119 | 129 | | |
120 | 130 | | |
121 | 131 | | |
| 132 | + | |
| 133 | + | |
122 | 134 | | |
123 | 135 | | |
124 | 136 | | |
| |||
169 | 181 | | |
170 | 182 | | |
171 | 183 | | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
176 | 198 | | |
177 | 199 | | |
178 | 200 | | |
| |||
182 | 204 | | |
183 | 205 | | |
184 | 206 | | |
185 | | - | |
| 207 | + | |
186 | 208 | | |
187 | 209 | | |
188 | 210 | | |
| |||
191 | 213 | | |
192 | 214 | | |
193 | 215 | | |
194 | | - | |
195 | | - | |
| 216 | + | |
| 217 | + | |
196 | 218 | | |
197 | | - | |
| 219 | + | |
198 | 220 | | |
199 | 221 | | |
200 | | - | |
| 222 | + | |
201 | 223 | | |
202 | 224 | | |
203 | 225 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
586 | 587 | | |
587 | 588 | | |
588 | 589 | | |
589 | | - | |
| 590 | + | |
590 | 591 | | |
591 | | - | |
592 | | - | |
593 | | - | |
594 | | - | |
595 | | - | |
596 | | - | |
597 | | - | |
598 | | - | |
599 | | - | |
600 | | - | |
601 | | - | |
602 | | - | |
603 | | - | |
604 | | - | |
605 | | - | |
606 | | - | |
607 | | - | |
608 | | - | |
609 | | - | |
610 | | - | |
611 | | - | |
612 | | - | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
613 | 616 | | |
614 | 617 | | |
615 | 618 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
105 | 107 | | |
106 | 108 | | |
107 | 109 | | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
114 | 119 | | |
115 | 120 | | |
116 | 121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
| |||
323 | 322 | | |
324 | 323 | | |
325 | 324 | | |
326 | | - | |
| 325 | + | |
327 | 326 | | |
328 | 327 | | |
329 | 328 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
| 49 | + | |
49 | 50 | | |
50 | | - | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
| 204 | + | |
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| |||
572 | 572 | | |
573 | 573 | | |
574 | 574 | | |
575 | | - | |
| 575 | + | |
576 | 576 | | |
577 | 577 | | |
578 | 578 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
137 | 141 | | |
138 | 142 | | |
139 | 143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
132 | 134 | | |
133 | 135 | | |
134 | 136 | | |
135 | | - | |
136 | | - | |
137 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
138 | 140 | | |
139 | 141 | | |
140 | 142 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
| |||
125 | 124 | | |
126 | 125 | | |
127 | 126 | | |
128 | | - | |
| 127 | + | |
129 | 128 | | |
130 | 129 | | |
131 | 130 | | |
| |||
0 commit comments