Skip to content

SNOW-3061745: Propagate parameter bindings in nested CALL operations#4192

Merged
sfc-gh-joshi merged 3 commits into
mainfrom
joshi-SNOW-3061745-prepare-call
Apr 28, 2026
Merged

SNOW-3061745: Propagate parameter bindings in nested CALL operations#4192
sfc-gh-joshi merged 3 commits into
mainfrom
joshi-SNOW-3061745-prepare-call

Conversation

@sfc-gh-joshi

@sfc-gh-joshi sfc-gh-joshi commented Apr 22, 2026

Copy link
Copy Markdown
Contributor
  1. Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.

    Fixes SNOW-3061745

  2. Fill out the following pre-review checklist:

    • I am adding a new automated test(s) to verify correctness of my new code
      • If this test skips Local Testing mode, I'm requesting review from @snowflakedb/local-testing
    • I am adding new logging messages
    • I am adding a new telemetry message
    • I am adding new credentials
    • I am adding a new dependency
    • If this is a new feature/behavior, I'm adding the Local Testing parity changes.
    • I acknowledge that I have ensured my changes to be thread-safe. Follow the link for more information: Thread-safe Developer Guidelines
    • If adding any arguments to public Snowpark APIs or creating new public Snowpark APIs, I acknowledge that I have ensured my changes include AST support. Follow the link for more information: AST Support Guidelines
  3. Please describe how your code solves the related issue.

Fixes an issue where DESCRIBE queries for CALL queries with parameter bindings were raising an error. This occurred because internal DESCRIBE calls to analyze_attributes were not passing query parameters with certain chained operations.

High-level control flow (generated by cursor):

df = session.sql("CALL identifier(?)(?, parse_json(?))", params)
df.select("*")
  │
  ├─ self.column_states
  │    └─ SnowflakePlan._analyze_attributes()     [passes query_params ✓]
  │         └─ _describe_internal(sql, params=[...])
  │              → describeOnly:true, but server EXECUTES the CALL to get schema
  │              → Snowhouse type: CALL
  │              → SP runs, hits 'invalid identifier IDT.STATE'
  │              → But returns result metadata OK (schema determined)
  │
  └─ self.from_.to_subqueryable()
       └─ SelectSQL.__init__(convert_to_select=True)
            └─ _analyze_attributes(sql, session, uuid)  [drops query_params ✗]
                 └─ _describe_internal(sql, params=None)
                      → describeOnly:true, server can't compile without bindings
                      → Snowhouse type: DESCRIBE_QUERY
                      → "Bind variable for object '1' not set"
                      → RAISED TO USER

@github-actions

github-actions Bot commented Apr 22, 2026

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@codecov-commenter

codecov-commenter commented Apr 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.17%. Comparing base (160c418) to head (f71952d).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4192   +/-   ##
=======================================
  Coverage   95.17%   95.17%           
=======================================
  Files         171      171           
  Lines       43801    43801           
  Branches     7505     7505           
=======================================
+ Hits        41686    41687    +1     
+ Misses       1294     1293    -1     
  Partials      821      821           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sfc-gh-joshi sfc-gh-joshi force-pushed the joshi-SNOW-3061745-prepare-call branch from 27c6c9f to 003d251 Compare April 22, 2026 18:50
@sfc-gh-joshi sfc-gh-joshi marked this pull request as ready for review April 22, 2026 18:55
@sfc-gh-joshi sfc-gh-joshi requested review from a team as code owners April 22, 2026 18:55
@sfc-gh-joshi sfc-gh-joshi force-pushed the joshi-SNOW-3061745-prepare-call branch from 003d251 to 898e394 Compare April 28, 2026 17:51

@sfc-gh-mayliu sfc-gh-mayliu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, seems like some AI function tests are failing due to deprecated models though

@sfc-gh-joshi sfc-gh-joshi force-pushed the joshi-SNOW-3061745-prepare-call branch from e02db80 to f71952d Compare April 28, 2026 22:30
@sfc-gh-joshi sfc-gh-joshi merged commit f6addbf into main Apr 28, 2026
29 checks passed
@sfc-gh-joshi sfc-gh-joshi deleted the joshi-SNOW-3061745-prepare-call branch April 28, 2026 23:48
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants