-
Notifications
You must be signed in to change notification settings - Fork 112
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-876999: Add support for timezone-aware type annotation on UDF #979
Conversation
Codecov Report
@@ Coverage Diff @@
## main #979 +/- ##
==========================================
- Coverage 98.35% 98.34% -0.01%
==========================================
Files 51 51
Lines 9227 9298 +71
Branches 1671 1691 +20
==========================================
+ Hits 9075 9144 +69
- Misses 61 62 +1
- Partials 91 92 +1
... and 7 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
Please also address the comment about test coverage for default case :)
timezone = TimestampTimeZone.LTZ | ||
elif tp_args[0] == TZ: | ||
timezone = TimestampTimeZone.TZ | ||
else: |
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.
Just curious: what can this else
be? Or should we actually raise?
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.
Actually it can be Timestamp[int]
, which is invalid and we should raise an exception here, good catch! I added tests to cover these code path.
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.
Fixes SNOW-876999
Fill out the following pre-review checklist:
Please describe how your code solves the related issue.
Previously we add support for timestamp variations in data types, but we also need such support for UDFs with type annotations.