From 9b4ea11c43eb9581cde3acd0b323840cf6a41354 Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 7 Aug 2024 14:00:17 +0200 Subject: [PATCH] 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 cc46f075f..741e38649 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; @@ -238,8 +238,8 @@ impl ViewVersionLog { } /// Returns the last updated timestamp as a DateTime with millisecond precision. - pub fn timestamp(self) -> MappedLocalTime> { - Utc.timestamp_millis_opt(self.timestamp_ms) + pub fn timestamp(self) -> Result> { + timestamp_ms_to_utc(self.timestamp_ms) } }