c-thiel commented on code in PR #331: URL: https://github.com/apache/iceberg-rust/pull/331#discussion_r1690898177
########## crates/iceberg/src/spec/table_metadata.rs: ########## @@ -144,8 +144,24 @@ impl TableMetadata { /// Returns last updated time. #[inline] - pub fn last_updated_ms(&self) -> DateTime<Utc> { - Utc.timestamp_millis_opt(self.last_updated_ms).unwrap() + pub fn last_updated_timestamp(&self) -> Result<DateTime<Utc>> { + match Utc.timestamp_millis_opt(self.last_updated_ms) { + MappedLocalTime::Single(t) => Ok(t), + MappedLocalTime::Ambiguous(_, _) => Err(Error::new( + ErrorKind::Unexpected, + "Ambiguous timestamp in table metadata last updated", + )), + MappedLocalTime::None => Err(Error::new( + ErrorKind::Unexpected, + "Invalid timestamp in table metadata last updated", Review Comment: https://github.com/c-thiel/iceberg-rust/commit/ea7f2ea9e35be6d4f42e89a9e22938661272e209 -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org