Repository navigation
fix(convert): resolve qualified calls to project functions - #343
Merged
Merged
Conversation
Snowflake resolves a two- or three-part function call against the functions declared in the schema. Conversion now does the same: a qualified call to a declared function converts to the registered function, an undeclared one refuses with a message naming it, and a name that matches functions in several databases refuses and asks for the full name or a session DATABASE. The runtime extra pins the duckdb version register_functions needs.
A subquery calling a volatile function by its qualified name now refuses inside a lambda, and the volatile-call count folds quoted names as conversion does. A three-part name matches only its own key, and a qualified call to an unknown function says to declare it among the project's functions.
kvlonge
enabled auto-merge
November 30, 2026 12:17
…aseline Refusals of SNOWFLAKE.NOTIFICATION.TEXT_HTML, TEXT_PLAIN and SANITIZE_WEBHOOK_CONTENT now name the function, so those forms measure as refused and OBJECT_KEYS beside them as matching.
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
Snowflake resolves a two- or three-part function call, such as
analytics.udfs.normalize_email(email), against the functions declared in the schema. Conversion treated these calls as method calls and refused them asMETHOD CALL, so SQL calling a project's Python functions by their qualified name could not run throughregister_functions.Changes
schema.functions: an exact match on the written parts, otherwise the one declared name with more parts that ends in them. A two-part name takes the session'sDATABASE.DATABASE; it never picks one.sources/*.yml.runtimeextra pins the DuckDB versionregister_functionsneeds (pip install "sqlbabel[runtime]"). The Python docs cover the extra and qualified names.Verification
DATABASE; a quoted schema underQUOTED_IDENTIFIERS_IGNORE_CASE; an undeclared call and an ambiguous call refused; the extra's pin.cargo fmt --check, clippy-D warningson the changed crates,fensu check, ruff and ty are clean.