Skip to content

Commit

Permalink
Merge branch 'main' into better-sf-wg-error
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex authored Mar 11, 2024
2 parents 5724f79 + 2bf9ac4 commit 6d084cf
Show file tree
Hide file tree
Showing 4 changed files with 388 additions and 320 deletions.
54 changes: 27 additions & 27 deletions nexus/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions nexus/peer-bigquery/src/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::{
task::{Context, Poll},
};

use chrono::{NaiveDateTime, TimeZone, Utc};
use chrono::DateTime;
use futures::Stream;
use gcp_bigquery_client::model::{
field_type::FieldType, query_response::ResultSet, table_field_schema::TableFieldSchema,
Expand Down Expand Up @@ -155,9 +155,9 @@ impl BqRecordStream {
FieldType::Timestamp => {
let timestamp = result_set.get_i64_by_name(field_name)?;
if let Some(ts) = timestamp {
let naive_datetime = NaiveDateTime::from_timestamp_opt(ts, 0)
.ok_or(anyhow::Error::msg("Invalid naive datetime"))?;
Some(Value::Timestamp(Utc.from_utc_datetime(&naive_datetime)))
let datetime = DateTime::from_timestamp(ts, 0)
.ok_or(anyhow::Error::msg("Invalid datetime"))?;
Some(Value::Timestamp(datetime))
} else {
None
}
Expand Down
Loading

0 comments on commit 6d084cf

Please sign in to comment.