-
Notifications
You must be signed in to change notification settings - Fork 110
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
SNOW-862622 Add support for timestamp variations #943
Conversation
025b930
to
53dcd6a
Compare
Codecov Report
@@ Coverage Diff @@
## main #943 +/- ##
=======================================
Coverage 98.46% 98.47%
=======================================
Files 51 51
Lines 9079 9122 +43
Branches 1626 1642 +16
=======================================
+ Hits 8940 8983 +43
Misses 55 55
Partials 84 84
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
53dcd6a
to
1a68d81
Compare
1a68d81
to
ccd6bdc
Compare
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.
Looks good. You might want to test in stored proc (job) and see if it works.
running https://ci-dev-142.int.snowflakecomputing.com/job/PythonStoredProcBuildPrecommitTest/464/ |
@@ -285,6 +294,10 @@ def infer_type(obj: Any) -> DataType: | |||
if datatype is DecimalType: | |||
# the precision and scale of `obj` may be different from row to row. | |||
return DecimalType(38, 18) | |||
elif datatype is TimestampType and obj.tzinfo is not None: |
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.
@sfc-gh-yzou ^^^
530c10e
to
9d43416
Compare
e4b5f9a
to
63a9a2b
Compare
63a9a2b
to
5eb0d94
Compare
Please answer these questions before submitting your pull requests. Thanks!
What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
SNOW-862622 Add support for timestamp variations
Fill out the following pre-review checklist:
Please describe how your code solves the related issue.
Please write a short description of how your code change solves the related issue.
This PR adds support for Snowflake timestamp variations, e.g., TIMESTAMP_NTZ, TIMESTAMP_TZ, TIMESTAMP_LTZ. Today Snowpark Python only supports Timestamp alias for Timestamp types and the underlying type is controlled by TIMESTAMP_TYPE_MAPPING. This PR allows user to specify which variation of TIMESTAMP type to use by adding a
TimestampType
attributetz
.