Skip to content

Conversation

sfc-gh-jvenegasvega-1
Copy link
Contributor

@sfc-gh-jvenegasvega-1 sfc-gh-jvenegasvega-1 commented Sep 18, 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-2347914

  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.

This pull request adds new overloads for the try_to_timestamp and try_to_date functions in both Java and Scala APIs, allowing users to pass the format as a plain String in addition to the existing Column-based approach. It also updates documentation and test cases to reflect these changes and clarify usage. These improvements make the APIs more flexible and user-friendly.

API Enhancements

  • Added new overloads for try_to_timestamp and try_to_date in Functions.java and functions.scala that accept the format as a String, making it easier to use these functions without needing to wrap the format in a Column (lit). [1] [2] [3] [4]

Documentation Updates

  • Updated JavaDoc and ScalaDoc comments for try_to_timestamp and try_to_date to clarify the accepted types for the format parameter and to provide examples for both the Column and String overloads. [1] [2] [3] [4]

  • Revised code examples in documentation to show usage with both lit() and plain String format arguments for better clarity. [1] [2] [3] [4]

Test Coverage

  • Added new test cases in both Java (JavaFunctionSuite.java) and Scala (FunctionSuite.scala) to verify the new overloads work as expected and produce the same results as the existing Column overloads. [1] [2] [3] [4]

@sfc-gh-jvenegasvega-1 sfc-gh-jvenegasvega-1 changed the title SNOW-2347914: Adding try_to_date and try_to_timestamp overloads to ac… SNOW-2347914: Adding try_to_date and try_to_timestamp string format arg Sep 18, 2025
Copy link
Contributor

@sfc-gh-mvegaalvarez sfc-gh-mvegaalvarez left a comment

Choose a reason for hiding this comment

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

lg

@Copilot Copilot AI review requested due to automatic review settings September 18, 2025 19:54
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 adds new overloads for the try_to_timestamp and try_to_date functions that accept format parameters as plain String values instead of requiring Column objects, making these functions more convenient to use.

  • Adds String-based overloads for try_to_timestamp and try_to_date in both Java and Scala APIs
  • Updates documentation with improved examples showing both Column and String usage patterns
  • Includes comprehensive test coverage for the new String-based overloads

Reviewed Changes

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

File Description
src/main/java/com/snowflake/snowpark_java/Functions.java Adds new String overloads for try_to_timestamp and try_to_date with updated JavaDoc
src/main/scala/com/snowflake/snowpark/functions.scala Adds new String overloads for try_to_timestamp and try_to_date with updated ScalaDoc
src/test/java/com/snowflake/snowpark_test/JavaFunctionSuite.java Adds test cases for the new String-based function overloads
src/test/scala/com/snowflake/snowpark_test/FunctionSuite.scala Adds test cases for the new String-based function overloads

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.

3 participants