This is an automated email from the ASF dual-hosted git repository.

xuanwo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg-rust.git


The following commit(s) were added to refs/heads/main by this push:
     new 9b4ea11  Fix: MappedLocalTime should not be exposed (#529)
9b4ea11 is described below

commit 9b4ea11c43eb9581cde3acd0b323840cf6a41354
Author: Christian <[email protected]>
AuthorDate: Wed Aug 7 14:00:17 2024 +0200

    Fix: MappedLocalTime should not be exposed (#529)
---
 crates/iceberg/src/spec/view_metadata.rs | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/crates/iceberg/src/spec/view_metadata.rs 
b/crates/iceberg/src/spec/view_metadata.rs
index cc46f07..741e386 100644
--- a/crates/iceberg/src/spec/view_metadata.rs
+++ b/crates/iceberg/src/spec/view_metadata.rs
@@ -24,7 +24,7 @@ use std::fmt::{Display, Formatter};
 use std::sync::Arc;
 
 use _serde::ViewMetadataEnum;
-use chrono::{DateTime, MappedLocalTime, TimeZone, Utc};
+use chrono::{DateTime, Utc};
 use serde::{Deserialize, Serialize};
 use serde_repr::{Deserialize_repr, Serialize_repr};
 use uuid::Uuid;
@@ -32,7 +32,7 @@ use uuid::Uuid;
 use super::view_version::{ViewVersion, ViewVersionId, ViewVersionRef};
 use super::{SchemaId, SchemaRef};
 use crate::catalog::ViewCreation;
-use crate::error::Result;
+use crate::error::{timestamp_ms_to_utc, Result};
 
 /// Reference to [`ViewMetadata`].
 pub type ViewMetadataRef = Arc<ViewMetadata>;
@@ -238,8 +238,8 @@ impl ViewVersionLog {
     }
 
     /// Returns the last updated timestamp as a DateTime<Utc> with millisecond 
precision.
-    pub fn timestamp(self) -> MappedLocalTime<DateTime<Utc>> {
-        Utc.timestamp_millis_opt(self.timestamp_ms)
+    pub fn timestamp(self) -> Result<DateTime<Utc>> {
+        timestamp_ms_to_utc(self.timestamp_ms)
     }
 }
 

Reply via email to