-
Notifications
You must be signed in to change notification settings - Fork 22
SNOW-2347914: Adding try_to_date and try_to_timestamp string format arg #247
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
base: main
Are you sure you want to change the base?
Conversation
…cept string format as argument
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lg
There was a problem hiding this 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
andtry_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.
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
Fill out the following pre-review checklist:
Please describe how your code solves the related issue.
This pull request adds new overloads for the
try_to_timestamp
andtry_to_date
functions in both Java and Scala APIs, allowing users to pass the format as a plainString
in addition to the existingColumn
-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
try_to_timestamp
andtry_to_date
inFunctions.java
andfunctions.scala
that accept the format as aString
, making it easier to use these functions without needing to wrap the format in aColumn
(lit
). [1] [2] [3] [4]Documentation Updates
Updated JavaDoc and ScalaDoc comments for
try_to_timestamp
andtry_to_date
to clarify the accepted types for the format parameter and to provide examples for both theColumn
andString
overloads. [1] [2] [3] [4]Revised code examples in documentation to show usage with both
lit()
and plainString
format arguments for better clarity. [1] [2] [3] [4]Test Coverage
JavaFunctionSuite.java
) and Scala (FunctionSuite.scala
) to verify the new overloads work as expected and produce the same results as the existingColumn
overloads. [1] [2] [3] [4]