Skip to content

Conversation

sfc-gh-fgonzalezmendez
Copy link
Collaborator

@sfc-gh-fgonzalezmendez sfc-gh-fgonzalezmendez commented Sep 19, 2025

  1. What Jira ticket or GitHub issue is this PR addressing? Make sure that there is a ticket or issue accompanying your PR.

    Fixes SNOW-2249991

  2. Fill out the following pre-review checklist:

    • I am adding a new automated test(s) to verify correctness of my new code
    • I am adding new logging messages
    • I am adding a new telemetry message
    • I am adding new credentials
    • I am adding a new dependency
  3. Please describe how your code solves the related issue.

    The following functions of com.snowflake.snowpark.Column now accepts a parameter of type Any/Object:

    • equal_to
    • not_equal
    • gt
    • lt
    • leq
    • geq
    • equal_null
    • plus
    • minus
    • multiply
    • divide
    • mod

@sfc-gh-fgonzalezmendez sfc-gh-fgonzalezmendez changed the title SNOW-2249991 Enhance several Column functions to accept any value type SNOW-2249991 Enhance several Column functions to accept Any/Object parameters Sep 22, 2025
@sfc-gh-fgonzalezmendez sfc-gh-fgonzalezmendez marked this pull request as ready for review September 22, 2025 16:00
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the Column class to accept Any/Object parameters for several comparison and arithmetic operations instead of requiring only Column parameters. The enhancement allows users to pass literal values directly without explicitly wrapping them with lit().

Key changes:

  • Modified Column method signatures to accept Any (Scala) or Object (Java) instead of just Column types
  • Added comprehensive test coverage for the new parameter types
  • Refactored duplicate code by introducing a shared toScalaColumn utility method

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/main/scala/com/snowflake/snowpark/Column.scala Updated method signatures for comparison and arithmetic operations to accept Any
src/main/java/com/snowflake/snowpark_java/Column.java Updated Java Column methods to accept Object and added toScalaColumn utility method
src/main/java/com/snowflake/snowpark_java/Functions.java Removed duplicate toExpr method and updated when function to use shared utility
src/main/java/com/snowflake/snowpark_java/CaseExpr.java Refactored to use shared toScalaColumn utility method
src/main/java/com/snowflake/snowpark_java/GroupingSets.java Updated lambda expression to use method reference syntax
src/test/scala/com/snowflake/snowpark_test/ColumnSuite.scala Added test cases for new parameter types and refactored for better readability
src/test/java/com/snowflake/snowpark_test/JavaColumnSuite.java Enhanced test coverage to verify new Object parameter functionality

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants