Skip to content

SNOW-1856438: Directly support Snowflake Cortex functions Summarize and Sentiment with apply #2943

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

sfc-gh-lmukhopadhyay
Copy link
Contributor

@sfc-gh-lmukhopadhyay sfc-gh-lmukhopadhyay commented Jan 27, 2025

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

    Fixes SNOW-1856438

  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
  3. Please describe how your code solves the related issue.

    Supporting Snowflake Cortex LLM APIS Summarize and Sentiment with df/ series apply

Example:

 from snowflake.cortex import Sentiment

 content = "This is a really great sentence."
 s = pd.Series([content])
 s.apply(Sentiment).iloc[0]
 >>> 0.872

Signed-off-by: Labanya Mukhopadhyay <labanya.mukhopadhyay@snowflake.com>
Signed-off-by: Labanya Mukhopadhyay <labanya.mukhopadhyay@snowflake.com>
Signed-off-by: Labanya Mukhopadhyay <labanya.mukhopadhyay@snowflake.com>
Signed-off-by: Labanya Mukhopadhyay <labanya.mukhopadhyay@snowflake.com>
@sfc-gh-lmukhopadhyay sfc-gh-lmukhopadhyay added the NO-PANDAS-CHANGEDOC-UPDATES This PR does not update Snowpark pandas docs label Jan 29, 2025
Signed-off-by: Labanya Mukhopadhyay <labanya.mukhopadhyay@snowflake.com>
Signed-off-by: Labanya Mukhopadhyay <labanya.mukhopadhyay@snowflake.com>
Signed-off-by: Labanya Mukhopadhyay <labanya.mukhopadhyay@snowflake.com>
Signed-off-by: Labanya Mukhopadhyay <labanya.mukhopadhyay@snowflake.com>
@sfc-gh-lmukhopadhyay sfc-gh-lmukhopadhyay changed the title SNOW-1856438: Directly support Snowflake Cortex functions ClassifyText, Summarize, and Sentiment with apply SNOW-1856438: Directly support Snowflake Cortex functions Summarize and Sentiment with apply Feb 5, 2025
Signed-off-by: Labanya Mukhopadhyay <labanya.mukhopadhyay@snowflake.com>
Copy link
Contributor

@sfc-gh-mvashishtha sfc-gh-mvashishtha left a comment

Choose a reason for hiding this comment

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

I just have two minor comments

Signed-off-by: Labanya Mukhopadhyay <labanya.mukhopadhyay@snowflake.com>
Signed-off-by: Labanya Mukhopadhyay <labanya.mukhopadhyay@snowflake.com>
CHANGELOG.md Outdated
Comment on lines 16 to 17
- Added a test dependency for `snowflake-ml-python`.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need to call out test dependency

Signed-off-by: Labanya Mukhopadhyay <labanya.mukhopadhyay@snowflake.com>
Signed-off-by: Labanya Mukhopadhyay <labanya.mukhopadhyay@snowflake.com>
Signed-off-by: Labanya Mukhopadhyay <labanya.mukhopadhyay@snowflake.com>
Signed-off-by: Labanya Mukhopadhyay <labanya.mukhopadhyay@snowflake.com>
Signed-off-by: Labanya Mukhopadhyay <labanya.mukhopadhyay@snowflake.com>
@sfc-gh-lmukhopadhyay sfc-gh-lmukhopadhyay enabled auto-merge (squash) February 7, 2025 20:27
@sfc-gh-lmukhopadhyay sfc-gh-lmukhopadhyay merged commit ac482f5 into main Feb 7, 2025
39 checks passed
@sfc-gh-lmukhopadhyay sfc-gh-lmukhopadhyay deleted the lmukhopadhyay-SNOW-1856438-cortex-funcs-apply branch February 7, 2025 21:01
@github-actions github-actions bot locked and limited conversation to collaborators Feb 7, 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.

6 participants