-
Notifications
You must be signed in to change notification settings - Fork 853
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
Allow casting Timestamp arrays into String #664
Conversation
Thanks @sum12 -- I plan to check this out tomorrow |
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.
This is looking good @sum12 . I left some style comments -- but the only thing this PR really needs to be good to go is some basic tests. Perhaps you can follow the style of the existing tests?
1675482
to
1f996d8
Compare
#[test] | ||
fn test_cast_timestamp_to_string() { | ||
let a = TimestampMillisecondArray::from_opt_vec( | ||
vec![Some(864000000005), Some(1545696000001), 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.
happy that we keep nulls now
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.
LGTM @alamb I'll leave it to you to have a final look + merge
Codecov Report
@@ Coverage Diff @@
## master #664 +/- ##
==========================================
- Coverage 82.50% 82.45% -0.05%
==========================================
Files 168 168
Lines 47237 47379 +142
==========================================
+ Hits 38971 39066 +95
- Misses 8266 8313 +47
Continue to review full report at Codecov.
|
the change adds uses the existing `PrimitiveArray::value_as_datetime` to support casting from `Timestamp(_,_)` to ``[Large]Utf8`.
1f996d8
to
d9de2de
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.
This looks great ! Thank you again for your contribution @sum12 -- I am sorry for the delay in reviewing.
the change adds uses the existing `PrimitiveArray::value_as_datetime` to support casting from `Timestamp(_,_)` to ``[Large]Utf8`.
the change adds uses the existing `PrimitiveArray::value_as_datetime` to support casting from `Timestamp(_,_)` to ``[Large]Utf8`. Co-authored-by: Sumit <[email protected]>
…e#698) the change adds uses the existing `PrimitiveArray::value_as_datetime` to support casting from `Timestamp(_,_)` to ``[Large]Utf8`. Co-authored-by: Sumit <[email protected]>
…e#698) the change adds uses the existing `PrimitiveArray::value_as_datetime` to support casting from `Timestamp(_,_)` to ``[Large]Utf8`. Co-authored-by: Sumit <[email protected]>
Which issue does this PR close?
Closes #587
Rationale for this change
What changes are included in this PR?
there are two commits included in the PR
the first commit shows how it should be possible to implement. But the commit fails to compile with
and compiles fine with second commit. But it feels not correct to use the second commit as the
ArrowNumericType
and Timestamp* types are not really releated. (Or I do not understand them correctly)Are there any user-facing changes?
yes (additional ways to cast array) (where do I document this ?)
no breaking changes