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.
alamb
left a comment
There was a problem hiding this comment.
Looks great -- thank you @src255
cc @waitingkuo
| /// 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 { |
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_utcmethod is implemented with the timezone"+00:00". Two leading zeros are used for consistency with non-zero offsets. Also, the signature ofwith_timezonehas been changed:Are there any user-facing changes?
The
with_timezonenow accepts&strin addition toString. For example,