martin-g commented on a change in pull request #832:
URL: https://github.com/apache/arrow-rs/pull/832#discussion_r731193115
##########
File path: arrow/src/csv/reader.rs
##########
@@ -1371,6 +1372,95 @@ mod tests {
);
}
+ /// Interprets a naive_datetime (with no explicit timzone offset)
+ /// using the local timezone and returns the timestamp in UTC (0
+ /// offset)
+ fn naive_datetime_to_timestamp(naive_datetime: &NaiveDateTime) -> i64 {
+ // Note: Use chrono APIs that are different than
+ // naive_datetime_to_timestamp to compute the utc offset to
+ // try and double check the logic
+ let utc_offset_secs = match
Local.offset_from_local_datetime(naive_datetime) {
+ LocalResult::Single(local_offset) => {
+ local_offset.fix().local_minus_utc() as i64
+ }
+ _ => panic!("Unexpected failure converting to local datetime"),
Review comment:
would it be useful to print the naive_datetime for easier debugging ?
##########
File path: arrow/src/csv/reader.rs
##########
@@ -1371,6 +1372,95 @@ mod tests {
);
}
+ /// Interprets a naive_datetime (with no explicit timzone offset)
Review comment:
s/timzone/tim`e`zone/
--
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]