c-thiel commented on code in PR #331:
URL: https://github.com/apache/iceberg-rust/pull/331#discussion_r1690895876
##########
crates/iceberg/src/spec/view_version.rs:
##########
@@ -71,8 +74,18 @@ impl ViewVersion {
/// Get the timestamp of when the view version was created
#[inline]
- pub fn timestamp(&self) -> MappedLocalTime<DateTime<Utc>> {
- Utc.timestamp_millis_opt(self.timestamp_ms)
+ pub fn timestamp(&self) -> Result<DateTime<Utc>> {
+ match Utc.timestamp_millis_opt(self.timestamp_ms) {
Review Comment:
Hm, I added it to the error module but I am not happy with it.
https://github.com/c-thiel/iceberg-rust/commit/82dc949d838ea5e3ad769d3cabd3ee4a2262118b
The problem is that the result of `Utc.timestamp_millis_opt(timestamp_ms)`
offers no built-in method to convert it to an `Result`. So we cannot use `?`
but require a uitility function instead. The one I've written is only remotely
related to errors - which is why I don't really like it to be in `errors.rs`. I
am not sure though if it's worth adding a new utility module just for timestamp
conversions.
Any thoughts?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]