tustvold commented on code in PR #5605:
URL: https://github.com/apache/arrow-rs/pull/5605#discussion_r1562189527


##########
arrow-array/src/timezone.rs:
##########
@@ -83,7 +83,21 @@ mod private {
         Timezone(chrono_tz::Tz),
         Offset(FixedOffset),
     }
-
+    use chrono::DateTime;
+    use chrono::Utc;
+    impl Tz {
+        /// get timezone
+        pub fn get_time_zone_min(&self) -> i32 {
+            match self.0 {
+                TzInner::Timezone(tz) => {
+                    let utc_datetime: DateTime<Utc> = Utc::now();

Review Comment:
   This is incorrect, the timezone must be computed with reference to the time 
in question. Perhaps you could look at the other temporal cast kernels for 
inspiration



##########
arrow-array/src/array/primitive_array.rs:
##########
@@ -1366,7 +1366,12 @@ impl<T: ArrowTimestampType> PrimitiveArray<T> {
 
     /// Construct a timestamp array with new timezone
     pub fn with_timezone(self, timezone: impl Into<Arc<str>>) -> Self {
-        self.with_timezone_opt(Some(timezone.into()))
+        let timezone_arc = timezone.into();
+        if timezone_arc.eq_ignore_ascii_case("utc") {

Review Comment:
   This should be unnecessary



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to