Skip to content

Commit afd1df1

Browse files
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 errors
1 parent bbcfd7a commit afd1df1

305 files changed

Lines changed: 3366 additions & 3256 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎crates/sqlbuild-cache/src/hosted_shapes/constants.rs‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! The Python shape names of the natively hosted compiler shapes.
22
33
/// The Python model type a natively hosted compiler shape is captured as.
4-
pub const HOSTED_SHAPE_TYPES: [(&str, &str); 490] = [
4+
pub const HOSTED_SHAPE_TYPES: [(&str, &str); 491] = [
55
(
66
"sqlbuild._native:AlignedInterval",
77
"sqlbuild.cursor_algebra.models:AlignedInterval",
@@ -446,6 +446,10 @@ pub const HOSTED_SHAPE_TYPES: [(&str, &str); 490] = [
446446
"sqlbuild._native:DeclarationVisibilityIndex",
447447
"sqlbuild.compiler.scopes.models:DeclarationVisibilityIndex",
448448
),
449+
(
450+
"sqlbuild._native:CompiledResourceType",
451+
"sqlbuild.compiler.compile.types:CompiledResourceType",
452+
),
449453
(
450454
"sqlbuild._native:DefaultsConfig",
451455
"sqlbuild.spec.contracts.models:DefaultsConfig",

‎crates/sqlbuild-python/src/bindings/_helpers/analysis/explicit_references.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ impl<'py> PythonSqlOwner<'py> {
7777
/// Return P005, P007 and P008 errors and unmatched Python-SQL relations; raise P001.
7878
#[pyfunction]
7979
#[pyo3(signature = (*, project, discovered_inputs, enforce_explicit))]
80-
fn explicit_reference_report<'py>(
80+
pub(crate) fn explicit_reference_report<'py>(
8181
py: Python<'py>,
8282
project: &Bound<'py, PyAny>,
8383
discovered_inputs: &Bound<'py, PyAny>,

‎crates/sqlbuild-python/src/bindings/_helpers/analysis_session/stage_functions.rs‎

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ use crate::bindings::_helpers::analysis_session::session::{
2020
infer_expression_source_shapes, prove_dynamic_column_contracts,
2121
};
2222
use crate::bindings::_helpers::boundary::keyword_request::Request;
23+
use crate::bindings::_helpers::compile_driver::stage_work::{
24+
EXPRESSION_SHAPE_BATCHES, EXPRESSION_SHAPES_INFERRED, count_stage,
25+
};
2326
use crate::bindings::_helpers::records::fields::field as native_field;
2427
use crate::bindings::_helpers::records::ids::RecordId;
2528
use crate::bindings::_helpers::records::registry;
@@ -105,9 +108,16 @@ fn infer_native_expression_source_shapes<'py>(
105108
request: Option<&Bound<'py, PyDict>>,
106109
) -> PyResult<Bound<'py, PyTuple>> {
107110
let request = Request::new("infer_native_expression_source_shapes", request)?;
108-
let py: Python<'py> = request.py();
109-
let expressions: Bound<'py, PyAny> = request.get("expressions")?;
110-
let profile: Bound<'py, PyAny> = request.get("profile")?;
111+
expression_source_shapes(&request.get("expressions")?, &request.get("profile")?)
112+
}
113+
114+
/// One shape per expression, cached on `profile`'s binding catalog; a failure raises.
115+
pub(crate) fn expression_source_shapes<'py>(
116+
expressions: &Bound<'py, PyAny>,
117+
profile: &Bound<'py, PyAny>,
118+
) -> PyResult<Bound<'py, PyTuple>> {
119+
let py: Python<'py> = profile.py();
120+
let profile: Bound<'py, PyAny> = profile.clone();
111121
let dialect: String = aliased_dialect(py, profile_dialect(&profile)?)?;
112122
let catalog: Bound<'py, PyAny> = profile_catalog(&profile, &dialect)?;
113123
let cache: Bound<'py, PyAny> = native_field(&catalog, "expression_shapes")?;
@@ -119,6 +129,8 @@ fn infer_native_expression_source_shapes<'py>(
119129
}
120130
}
121131
if !pending.is_empty() {
132+
count_stage(py, EXPRESSION_SHAPE_BATCHES, 1)?;
133+
count_stage(py, EXPRESSION_SHAPES_INFERRED, pending.len() as u64)?;
122134
let (rules, adapter_rules) = nullability_rules(&profile)?;
123135
let native: PyRef<'py, ProjectCatalog> = native_field(&catalog, "native")?.extract()?;
124136
let pending_names: Vec<String> = pending
@@ -169,10 +181,20 @@ fn prove_native_dynamic_contracts<'py>(
169181
request: Option<&Bound<'py, PyDict>>,
170182
) -> PyResult<Bound<'py, PyTuple>> {
171183
let request = Request::new("prove_native_dynamic_contracts", request)?;
172-
let py: Python<'py> = request.py();
173-
let session: Bound<'py, PyAny> = request.get("session")?;
174-
let tables: Bound<'py, PyAny> = request.get("tables")?;
175-
let models: Bound<'py, PyAny> = request.get("models")?;
184+
dynamic_contract_proofs(
185+
&request.get("session")?,
186+
&request.get("tables")?,
187+
&request.get("models")?,
188+
)
189+
}
190+
191+
/// The proof row per `(sql, families)` model from `session`, or from `tables` without one.
192+
pub(crate) fn dynamic_contract_proofs<'py>(
193+
session: &Bound<'py, PyAny>,
194+
tables: &Bound<'py, PyAny>,
195+
models: &Bound<'py, PyAny>,
196+
) -> PyResult<Bound<'py, PyTuple>> {
197+
let py: Python<'py> = models.py();
176198
if !models.is_truthy()? {
177199
return Ok(PyTuple::empty(py));
178200
}
@@ -182,7 +204,7 @@ fn prove_native_dynamic_contracts<'py>(
182204
rows.push((sql, family_rows(&families)?));
183205
}
184206
let contracts: Vec<ContractRow> = if session.is_none() {
185-
let by_table: Bound<'py, PyAny> = native_field(&tables, "dynamic_families_by_table")?;
207+
let by_table: Bound<'py, PyAny> = native_field(tables, "dynamic_families_by_table")?;
186208
let mut families: Vec<(String, Vec<FamilyRow>)> = Vec::new();
187209
for item in by_table.call_method0("items")?.try_iter()? {
188210
let (name, declared): (String, Bound<'py, PyAny>) = item?.extract()?;
@@ -191,13 +213,13 @@ fn prove_native_dynamic_contracts<'py>(
191213
prove_dynamic_column_contracts(
192214
py,
193215
(
194-
dialect_or_generic(&native_field(&tables, "dialect")?)?,
195-
shape_rows(&native_field(&tables, "column_types_by_table")?)?,
216+
dialect_or_generic(&native_field(tables, "dialect")?)?,
217+
shape_rows(&native_field(tables, "column_types_by_table")?)?,
196218
shape_rows(&native_field(
197-
&tables,
219+
tables,
198220
"authoritative_column_types_by_table",
199221
)?)?,
200-
shape_rows(&native_field(&tables, "column_nullability_by_table")?)?,
222+
shape_rows(&native_field(tables, "column_nullability_by_table")?)?,
201223
families,
202224
rows,
203225
),

‎crates/sqlbuild-python/src/bindings/_helpers/build_command/defer_clone.rs‎

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use sqlbuild_core::build_command::errors::BuildCommandError;
1313

1414
use crate::bindings::_helpers::build_command::invocation::BuildContext;
1515
use crate::bindings::_helpers::build_command::policies::build_command_error;
16+
use crate::bindings::_helpers::compile_driver::project::build_compiled_project;
1617
use crate::bindings::_helpers::compile_driver::python_calls::{call_with, imported, keywords};
1718
use crate::bindings::_helpers::native_host::executor::ExecutorHost;
1819
use crate::bindings::_helpers::native_host::host;
@@ -586,30 +587,32 @@ pub(crate) fn run_defer_clone_boundary_prephase(
586587
}
587588
let adapter: Bound<'_, PyAny> = native_field(invocation, "adapter")?;
588589
let project_dir: Bound<'_, PyAny> = native_field(invocation, "effective_project_dir")?;
589-
let project: Bound<'_, PyAny> = native(
590+
let project: Bound<'_, PyAny> = build_compiled_project(
590591
py,
591-
NativeAttr::BuildCompiledProject,
592-
&[
593-
("discovered_inputs", discovered.clone()),
594-
("adapter", adapter.clone()),
595-
("selected_target", native_field(request, "selected_target")?),
596-
(
597-
"no_sql_validation",
598-
native_field(request, "no_sql_validation")?,
599-
),
600-
(
601-
"analysis_selection",
602-
call_with(
603-
&registry::class(py, RecordId::CompileAnalysisSelection)?,
604-
&[("no_cache", native_field(request, "no_cache")?)],
605-
)?,
606-
),
607-
("cli_vars", native_field(request, "cli_vars")?),
608-
(
609-
"external_sql_reference_resolver",
610-
external_resolver(&project_dir, &discovered)?,
611-
),
612-
],
592+
Some(keywords(
593+
py,
594+
&[
595+
("discovered_inputs", discovered.clone()),
596+
("adapter", adapter.clone()),
597+
("selected_target", native_field(request, "selected_target")?),
598+
(
599+
"no_sql_validation",
600+
native_field(request, "no_sql_validation")?,
601+
),
602+
(
603+
"analysis_selection",
604+
call_with(
605+
&registry::class(py, RecordId::CompileAnalysisSelection)?,
606+
&[("no_cache", native_field(request, "no_cache")?)],
607+
)?,
608+
),
609+
("cli_vars", native_field(request, "cli_vars")?),
610+
(
611+
"external_sql_reference_resolver",
612+
external_resolver(&project_dir, &discovered)?,
613+
),
614+
],
615+
)?),
613616
)?;
614617
let scope: Bound<'_, PyAny> = native(
615618
py,

‎crates/sqlbuild-python/src/bindings/_helpers/build_command/invocation.rs‎

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ use sqlbuild_core::build_command::models::DurationLimit;
1010
use crate::bindings::_helpers::build_command::policies::build_command_error;
1111
use crate::bindings::_helpers::build_command::support::{boolean, or_none, text};
1212
use crate::bindings::_helpers::command_runtime::adapters::resolve_cli_adapter;
13+
use crate::bindings::_helpers::compile_driver::discovery::discover_project_inputs;
14+
use crate::bindings::_helpers::compile_driver::python_calls::keywords;
1315
use crate::bindings::_helpers::compile_driver::python_calls::{call_with, imported};
1416
use crate::bindings::_helpers::presentation_text::terminal::stdout_supports_color;
1517
use crate::bindings::_helpers::records::fields::field as native_field;
@@ -105,12 +107,15 @@ pub(crate) fn resolve_build_context<'py>(
105107
let project_dir: Bound<'py, PyAny> = or_none(native_field(request, "project_dir")?, || {
106108
imported(py, "pathlib", "Path")?.call_method0("cwd")
107109
})?;
108-
let discovered: Bound<'py, PyAny> = call_with(
109-
&registry::native(py, NativeAttr::DiscoverProjectInputs)?,
110-
&[
111-
("project_dir", project_dir.clone()),
112-
("extract_output_column_locations", boolean(py, false)),
113-
],
110+
let discovered: Bound<'py, PyAny> = discover_project_inputs(
111+
py,
112+
Some(keywords(
113+
py,
114+
&[
115+
("project_dir", project_dir.clone()),
116+
("extract_output_column_locations", boolean(py, false)),
117+
],
118+
)?),
114119
)?;
115120
let selected_target: Bound<'py, PyAny> = native_field(request, "selected_target")?;
116121
let target_name: Bound<'py, PyAny> = call_with(

‎crates/sqlbuild-python/src/bindings/_helpers/build_command/lifecycle.rs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ use crate::bindings::_helpers::records::fields::field as native_field;
2222
use crate::bindings::_helpers::records::ids::{NativeAttr, RecordId};
2323
use crate::bindings::_helpers::records::registry;
2424

25-
const COMPILE_TYPES: &str = "sqlbuild.compiler.compile.types";
2625
const SUCCESS_STATUS: &str = "success";
2726

2827
/// The cursor window and output settings the Python lifecycle runs with.
@@ -323,7 +322,7 @@ fn lifecycle_plan<'py>(
323322
&[("selection", selection), ("python_graph", graph.clone())],
324323
)?;
325324
let source_type: Bound<'py, PyAny> =
326-
imported(py, COMPILE_TYPES, "CompiledResourceType")?.getattr("SOURCE")?;
325+
registry::class(py, RecordId::CompiledResourceType)?.getattr("SOURCE")?;
327326
let key_class: Bound<'py, PyAny> = registry::class(py, RecordId::CompiledObjectKey)?;
328327
let mut keys: Vec<Bound<'py, PyAny>> = Vec::new();
329328
for name in native_field(&plan, "ingress_loader_names")?.try_iter()? {

‎crates/sqlbuild-python/src/bindings/_helpers/check/check_command.rs‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,18 @@ use crate::bindings::_helpers::check::check_results::{
3636
check_result_text, results_json, write_results,
3737
};
3838
use crate::bindings::_helpers::command_runtime::invocation::resolve_reported_command_invocation;
39-
use crate::bindings::_helpers::compile_driver::python_calls::{call_with, imported};
39+
use crate::bindings::_helpers::compile_driver::python_calls::call_with;
4040
use crate::bindings::_helpers::compile_outputs::runtime_target::write_python_check_runtime_target;
4141
use crate::bindings::_helpers::graph::python_node_graph::python_node_graph;
4242
use crate::bindings::_helpers::graph::python_selection::python_node_names;
4343
use crate::bindings::_helpers::native_host::executor::ExecutorHost;
4444
use crate::bindings::_helpers::native_host::host;
4545
use crate::bindings::_helpers::native_host::user_code::UserCodeHost;
4646
use crate::bindings::_helpers::records::fields::field as native_field;
47-
use crate::bindings::_helpers::records::ids::{ErrorId, NativeAttr, RecordId};
47+
use crate::bindings::_helpers::records::ids::{ErrorId, RecordId};
4848
use crate::bindings::_helpers::records::registry;
49+
use crate::bindings::_helpers::result_output::event_writer::ExecutionEventWriter;
4950

50-
const COMPILE_TYPES: &str = "sqlbuild.compiler.compile.types";
5151
const GRAPH_OPERATOR_CODE: &str = "C681";
5252
const GRAPH_OPERATOR_MESSAGE: &str = "sqb check selectors do not support graph operators; \
5353
select checks directly without '+', '~', or path-between expansion";
@@ -201,7 +201,7 @@ fn compile_pipeline<'py>(
201201
let loaders: Bound<'py, PyFrozenSet> = PyFrozenSet::new(py, loaders)?;
202202
let key_class: Bound<'py, PyAny> = registry::class(py, RecordId::CompiledObjectKey)?;
203203
let source_type: Bound<'py, PyAny> =
204-
imported(py, COMPILE_TYPES, "CompiledResourceType")?.getattr("SOURCE")?;
204+
registry::class(py, RecordId::CompiledResourceType)?.getattr("SOURCE")?;
205205
let mut keys: Vec<Bound<'py, PyAny>> = Vec::new();
206206
for reference in required_refs.try_iter()? {
207207
keys.push(sql_ref_key(py, &reference?)?);
@@ -572,7 +572,7 @@ fn execute<'py>(
572572
let connection: Bound<'py, PyAny> =
573573
adapter.call_method1("connect", (native_field(invocation, "connection_config")?,))?;
574574
let event_writer: Bound<'py, PyAny> =
575-
registry::native(py, NativeAttr::ExecutionEventWriter)?.call0()?;
575+
Bound::new(py, ExecutionEventWriter::new(py, None)?)?.into_any();
576576
let executed: PyResult<Vec<Bound<'py, PyAny>>> = (|| {
577577
let projector: Bound<'py, PyAny> = current_native_progress_projector(py)?;
578578
if !projector.is_none() {

‎crates/sqlbuild-python/src/bindings/_helpers/cli/progress_reporters.rs‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ impl ConnectionProgressReporter {
4848
impl ConnectionProgressReporter {
4949
#[new]
5050
#[pyo3(signature = (**options))]
51-
fn new(py: Python<'_>, options: Option<Bound<'_, PyDict>>) -> PyResult<Self> {
51+
pub(crate) fn new(py: Python<'_>, options: Option<Bound<'_, PyDict>>) -> PyResult<Self> {
5252
let arguments: KeywordArguments<'_> = KeywordArguments::read(
5353
py,
5454
"ConnectionProgressReporter",
@@ -133,7 +133,11 @@ impl PlanningProgressReporter {
133133
impl PlanningProgressReporter {
134134
#[new]
135135
#[pyo3(signature = (*, stream, use_color = false))]
136-
fn new(py: Python<'_>, stream: &Bound<'_, PyAny>, use_color: bool) -> PyResult<Self> {
136+
pub(crate) fn new(
137+
py: Python<'_>,
138+
stream: &Bound<'_, PyAny>,
139+
use_color: bool,
140+
) -> PyResult<Self> {
137141
let status: Bound<'_, PyAny> = status_reporter(stream, use_color)?;
138142
Ok(Self {
139143
status: status.unbind(),

‎crates/sqlbuild-python/src/bindings/_helpers/clone/clone_command.rs‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ use crate::bindings::_helpers::clone::clone_execution::{
2424
use crate::bindings::_helpers::clone::clone_pipeline::{ClonePipeline, prepared_clone_pipeline};
2525
use crate::bindings::_helpers::clone::clone_progress::{clone_item_text, write_line};
2626
use crate::bindings::_helpers::command_runtime::adapters::resolve_cli_adapter;
27+
use crate::bindings::_helpers::compile_driver::discovery::discover_project_inputs;
28+
use crate::bindings::_helpers::compile_driver::python_calls::keywords;
2729
use crate::bindings::_helpers::compile_driver::python_calls::{call_with, within};
2830
use crate::bindings::_helpers::native_host::executor::ExecutorHost;
2931
use crate::bindings::_helpers::native_host::host;
@@ -132,9 +134,9 @@ fn invocation<'py>(py: Python<'py>, request: &Bound<'py, PyAny>) -> PyResult<Inv
132134
let stream: Bound<'py, PyAny> = py.import("sys")?.getattr("stdout")?;
133135
let progress: Bound<'py, PyAny> = progress_reporter(&stream, style)?;
134136
progress.call_method1("start", ("Discovering project...",))?;
135-
let discovered: Bound<'py, PyAny> = call_with(
136-
&registry::native(py, NativeAttr::DiscoverProjectInputs)?,
137-
&[("project_dir", project_dir.clone())],
137+
let discovered: Bound<'py, PyAny> = discover_project_inputs(
138+
py,
139+
Some(keywords(py, &[("project_dir", project_dir.clone())])?),
138140
)?;
139141
progress.call_method1("complete", ("Discovered project.",))?;
140142
call_with(

‎crates/sqlbuild-python/src/bindings/_helpers/clone/clone_execution.rs‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,13 @@ use crate::bindings::_helpers::clone::clone_command::Invocation;
1212
use crate::bindings::_helpers::clone::clone_progress::{
1313
CloneFingerprintReporter, CloneItemPrinter,
1414
};
15-
use crate::bindings::_helpers::compile_driver::python_calls::{call_with, imported, within};
15+
use crate::bindings::_helpers::compile_driver::python_calls::{call_with, within};
1616
use crate::bindings::_helpers::native_host::executor::ExecutorHost;
1717
use crate::bindings::_helpers::native_host::host;
1818
use crate::bindings::_helpers::records::fields::field as native_field;
1919
use crate::bindings::_helpers::records::ids::{NativeAttr, RecordId};
2020
use crate::bindings::_helpers::records::registry;
2121

22-
const COMPILE_TYPES: &str = "sqlbuild.compiler.compile.types";
2322
const DESTINATION_ENTRY_GROUPS: [&str; 4] = [
2423
"destination_source_entries",
2524
"destination_model_entries",
@@ -125,7 +124,7 @@ fn dependency_locations<'py>(
125124
let location_class: Bound<'py, PyAny> =
126125
registry::class(py, RecordId::CompiledRelationLocation)?;
127126
let source_type: Bound<'py, PyAny> =
128-
imported(py, COMPILE_TYPES, "CompiledResourceType")?.getattr("SOURCE")?;
127+
registry::class(py, RecordId::CompiledResourceType)?.getattr("SOURCE")?;
129128
for pair in source_map.call_method0("items")?.try_iter()? {
130129
let (name, source): (Bound<'py, PyAny>, Bound<'py, PyAny>) = pair?.extract()?;
131130
let table: Bound<'py, PyAny> = native_field(&source, "table")?;

0 commit comments

Comments
 (0)