From ad1d4b67d0bfebe44f4237ef45c0af9bef186ca4 Mon Sep 17 00:00:00 2001 From: Kevin Longe <273747162+kvlonge@users.noreply.github.com> Date: Thu, 19 Nov 2026 15:21:27 +0000 Subject: [PATCH] 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. --- .../src/analysis/main/register_queries.rs | 4 +++- .../src/bindings/_helpers/exported_constants/constants.rs | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/sqlbuild-python-compile/src/analysis/main/register_queries.rs b/crates/sqlbuild-python-compile/src/analysis/main/register_queries.rs index d8679405e7..7681d1aae8 100644 --- a/crates/sqlbuild-python-compile/src/analysis/main/register_queries.rs +++ b/crates/sqlbuild-python-compile/src/analysis/main/register_queries.rs @@ -1,9 +1,10 @@ -//! Register the queries functions and classes. +//! Register the queries functions and classes, and the shared parse call depth. use crate::analysis::_helpers::queries::parse_warehouse_type; use crate::analysis::_helpers::queries::query_fingerprint; use pyo3::prelude::{Bound, PyModule, PyModuleMethods, PyResult}; use pyo3::wrap_pyfunction; +use sqlbuild_analysis::parse_guard::constants::MAX_FUNCTION_CALL_DEPTH; use sqlbuild_python_project::analysis::main::register_binding_catalog::register_binding_catalog; use sqlbuild_python_project::references::main::register_explicit_references::register_explicit_references; @@ -15,5 +16,6 @@ pub fn register_queries(module: &Bound<'_, PyModule>) -> PyResult<()> { crate::analysis::_helpers::binding_locations::register(module)?; module.add_function(wrap_pyfunction!(query_fingerprint, module)?)?; module.add_function(wrap_pyfunction!(parse_warehouse_type, module)?)?; + module.add("MAX_FUNCTION_CALL_DEPTH", MAX_FUNCTION_CALL_DEPTH)?; Ok(()) } diff --git a/crates/sqlbuild-python/src/bindings/_helpers/exported_constants/constants.rs b/crates/sqlbuild-python/src/bindings/_helpers/exported_constants/constants.rs index 108c373165..510cd06cc0 100644 --- a/crates/sqlbuild-python/src/bindings/_helpers/exported_constants/constants.rs +++ b/crates/sqlbuild-python/src/bindings/_helpers/exported_constants/constants.rs @@ -8,7 +8,6 @@ use sqlbuild_analysis::fingerprint_storage::constants::{ COLUMN_TARGET_DATABASE, COLUMN_TARGET_NAME, COLUMN_TARGET_SCHEMA, COLUMN_TIMESTAMP, COLUMN_VERSION_HASH, NODE_TYPE_MODEL, NODE_TYPE_SEED, }; -use sqlbuild_analysis::parse_guard::constants::MAX_FUNCTION_CALL_DEPTH; use sqlbuild_analysis::snowflake_cost::constants::QUERY_TAG_APP; use sqlbuild_cli::compute_logs::constants::{ COMPUTE_LOG_FORMAT_VERSION, DEFAULT_RETENTION_COUNT, MAX_READ_BYTES, @@ -142,7 +141,6 @@ pub(crate) const EXPORTED_INTEGERS: &[(&str, i64)] = &[ "CUSTOM_HOST_PROTOCOL_VERSION", CUSTOM_HOST_PROTOCOL_VERSION as i64, ), - ("MAX_FUNCTION_CALL_DEPTH", MAX_FUNCTION_CALL_DEPTH as i64), ]; /// Text tuples exported under their Python names. pub(crate) const EXPORTED_TEXT_TUPLES: &[(&str, &[&str])] = &[(