Skip to content

Conversation

sfc-gh-joshi
Copy link
Contributor

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

    Fixes SNOW-2173644 and SNOW-2157873

  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.

SNOW-2157873 occurs because upstream modin does not implement __array_function__, instead converting to numpy ndarrays via __array__ when a numpy function is called on it. The presence of the extension wrapper for __array_function__ introduced by Snowpark pandas confuses numpy dispatch, causing unexpected AttributeErrors. This is fixed upstream with modin-project/modin#7617, and will presumably become available in the next modin release. On the Snowpark side, this PR adds relevant tests, and adds a version-guarded flag to remove the extension function and push it down to the query compiler.

SNOW-2173644 occurs in specific circumstances when determining switching conditions for the DataFrame constructor. Series objects are treated as dict-like, but Series.values is a property rather than a function. We thus skip over native_pd.Series objects in the dict-like check in move_to_me_cost.

@sfc-gh-joshi sfc-gh-joshi requested a review from a team as a code owner June 27, 2025 23:51
@sfc-gh-joshi sfc-gh-joshi added the NO-PANDAS-CHANGEDOC-UPDATES This PR does not update Snowpark pandas docs label Jun 27, 2025
@sfc-gh-mvashishtha sfc-gh-mvashishtha self-requested a review June 28, 2025 00:09
@sfc-gh-joshi sfc-gh-joshi merged commit 0452705 into main Jun 30, 2025
38 of 40 checks passed
@sfc-gh-joshi sfc-gh-joshi deleted the joshi/hybrid-np-fixes branch June 30, 2025 22:00
@github-actions github-actions bot locked and limited conversation to collaborators Jun 30, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

NO-PANDAS-CHANGEDOC-UPDATES This PR does not update Snowpark pandas docs snowpark-pandas

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants