viirya commented on code in PR #3494:
URL: https://github.com/apache/arrow-rs/pull/3494#discussion_r1064970751


##########
arrow-cast/src/parse.rs:
##########
@@ -121,6 +121,15 @@ pub fn string_to_timestamp_nanos(s: &str) -> Result<i64, 
ArrowError> {
         return Ok(ts.timestamp_nanos());
     }
 
+    // without a timezone specifier as a local time, only date
+    // Example: 2020-09-08
+    if let Ok(ts) = NaiveDate::parse_from_str(s, "%Y-%m-%d") {
+        return Ok(ts
+            .and_hms_opt(0, 0, 0)
+            .expect("Failed to parse date")

Review Comment:
   I think this will panic? It is better to return a `Err` instead.



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