diff --git a/Cargo.lock b/Cargo.lock index a7e376422e96..2519cf2a6335 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1493,9 +1493,9 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.30" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defd4e7873dbddba6c7c91e199c7fcb946abc4a6a4ac3195400bcfb01b5de877" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ "android-tzdata", "iana-time-zone", diff --git a/src/common/src/types/datetime.rs b/src/common/src/types/datetime.rs index dd02713e8f21..69f049736cb9 100644 --- a/src/common/src/types/datetime.rs +++ b/src/common/src/types/datetime.rs @@ -324,7 +324,7 @@ impl Timestamp { } pub fn get_timestamp_nanos(&self) -> i64 { - self.0.timestamp_nanos() + self.0.timestamp_nanos_opt().unwrap() } pub fn with_micros(timestamp_micros: i64) -> Result { diff --git a/src/connector/src/source/google_pubsub/source/message.rs b/src/connector/src/source/google_pubsub/source/message.rs index 490dc8623434..398ae82febad 100644 --- a/src/connector/src/source/google_pubsub/source/message.rs +++ b/src/connector/src/source/google_pubsub/source/message.rs @@ -50,7 +50,7 @@ impl From for SourceMessage { _ => Some(payload), } }, - offset: timestamp.timestamp_nanos().to_string(), + offset: timestamp.timestamp_nanos_opt().unwrap().to_string(), split_id, meta: SourceMeta::GooglePubsub(GooglePubsubMeta { timestamp: Some(timestamp.timestamp_millis()),