tustvold commented on code in PR #5764:
URL: https://github.com/apache/arrow-datafusion/pull/5764#discussion_r1152867872


##########
datafusion/common/src/scalar.rs:
##########
@@ -919,12 +1056,14 @@ fn with_timezone_to_naive_datetime(
 /// This function creates the [`NaiveDateTime`] object corresponding to the
 /// given timestamp, whose tick size is specified by `UNIT_NANOS`.
 #[inline]
-fn ticks_to_naive_datetime<const UNIT_NANOS: i64>(ticks: i64) -> 
Result<NaiveDateTime> {
-    NaiveDateTime::from_timestamp_opt(
-        (ticks * UNIT_NANOS) / 1_000_000_000,
-        ((ticks * UNIT_NANOS) % 1_000_000_000) as u32,
-    )
-    .ok_or_else(|| {
+fn ticks_to_naive_datetime<const UNIT_NANOS: i128>(ticks: i64) -> 
Result<NaiveDateTime> {

Review Comment:
   I think if we can't parse the timezone we should return an error, silently 
continuing I think would potentially be quite confusing



-- 
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