Skip to content

Commit ad1d4b6

Browse files
committed
refactor(analysis): export the shared call depth from the compile bindings
The Python bindings crate is at its code-line cap, so the analysis registration in sqlbuild-python-compile exports MAX_FUNCTION_CALL_DEPTH to sqlbuild._native instead of the bindings crate's constant table.
1 parent e4276d1 commit ad1d4b6

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎crates/sqlbuild-python-compile/src/analysis/main/register_queries.rs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
//! Register the queries functions and classes.
1+
//! Register the queries functions and classes, and the shared parse call depth.
22
33
use crate::analysis::_helpers::queries::parse_warehouse_type;
44
use crate::analysis::_helpers::queries::query_fingerprint;
55
use pyo3::prelude::{Bound, PyModule, PyModuleMethods, PyResult};
66
use pyo3::wrap_pyfunction;
7+
use sqlbuild_analysis::parse_guard::constants::MAX_FUNCTION_CALL_DEPTH;
78
use sqlbuild_python_project::analysis::main::register_binding_catalog::register_binding_catalog;
89
use sqlbuild_python_project::references::main::register_explicit_references::register_explicit_references;
910

@@ -15,5 +16,6 @@ pub fn register_queries(module: &Bound<'_, PyModule>) -> PyResult<()> {
1516
crate::analysis::_helpers::binding_locations::register(module)?;
1617
module.add_function(wrap_pyfunction!(query_fingerprint, module)?)?;
1718
module.add_function(wrap_pyfunction!(parse_warehouse_type, module)?)?;
19+
module.add("MAX_FUNCTION_CALL_DEPTH", MAX_FUNCTION_CALL_DEPTH)?;
1820
Ok(())
1921
}

‎crates/sqlbuild-python/src/bindings/_helpers/exported_constants/constants.rs‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use sqlbuild_analysis::fingerprint_storage::constants::{
88
COLUMN_TARGET_DATABASE, COLUMN_TARGET_NAME, COLUMN_TARGET_SCHEMA, COLUMN_TIMESTAMP,
99
COLUMN_VERSION_HASH, NODE_TYPE_MODEL, NODE_TYPE_SEED,
1010
};
11-
use sqlbuild_analysis::parse_guard::constants::MAX_FUNCTION_CALL_DEPTH;
1211
use sqlbuild_analysis::snowflake_cost::constants::QUERY_TAG_APP;
1312
use sqlbuild_cli::compute_logs::constants::{
1413
COMPUTE_LOG_FORMAT_VERSION, DEFAULT_RETENTION_COUNT, MAX_READ_BYTES,
@@ -142,7 +141,6 @@ pub(crate) const EXPORTED_INTEGERS: &[(&str, i64)] = &[
142141
"CUSTOM_HOST_PROTOCOL_VERSION",
143142
CUSTOM_HOST_PROTOCOL_VERSION as i64,
144143
),
145-
("MAX_FUNCTION_CALL_DEPTH", MAX_FUNCTION_CALL_DEPTH as i64),
146144
];
147145
/// Text tuples exported under their Python names.
148146
pub(crate) const EXPORTED_TEXT_TUPLES: &[(&str, &[&str])] = &[(

0 commit comments

Comments
 (0)