-
Notifications
You must be signed in to change notification settings - Fork 821
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
Improved UX of creating TimestampNanosecondArray
with timezones
#3088
Conversation
Make with_timezone method accept both &str and String values.
Add a method to PrimitiveArray<T: ArrowTimestampType> for using UTC as the timezone.
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 great -- thank you @src255
cc @waitingkuo
@@ -779,8 +779,13 @@ impl<T: ArrowTimestampType> PrimitiveArray<T> { | |||
} | |||
|
|||
/// Construct a timestamp array with new timezone | |||
pub fn with_timezone(&self, timezone: String) -> Self { | |||
self.with_timezone_opt(Some(timezone)) | |||
pub fn with_timezone(&self, timezone: impl Into<String>) -> Self { |
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.
❤️
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.
TimestampNanosecondArray
with timezones
I took the liberty of resolving the merge conflicts on this |
Benchmark runs are scheduled for baseline = 02a3f5c and contender = 561f63a. 561f63a is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
@tustvold Thank you for resolving the merge conflicts, I really appreciate it! |
Great team effort 👍 |
Which issue does this PR close?
Closes #3042
What changes are included in this PR?
The
with_timezone_utc
method is implemented with the timezone"+00:00"
. Two leading zeros are used for consistency with non-zero offsets. Also, the signature ofwith_timezone
has been changed:Are there any user-facing changes?
The
with_timezone
now accepts&str
in addition toString
. For example,