diff --git a/Cargo.lock b/Cargo.lock index 256529c67..c8a955c91 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -541,9 +541,9 @@ dependencies = [ [[package]] name = "async-openai" -version = "0.18.3" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dea5c9223f84965c603fd58c4c9ddcd1907efb2e54acf6fb47039358cd374df4" +checksum = "6791601019a2f14a6e5d3f7da849b5ff1594ef5c8da5492d63214c220449270c" dependencies = [ "async-convert", "backoff", @@ -1066,6 +1066,12 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +[[package]] +name = "base64" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" + [[package]] name = "base64-simd" version = "0.8.0" @@ -1495,9 +1501,9 @@ checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" [[package]] name = "chrono" -version = "0.4.34" +version = "0.4.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" +checksum = "8eaf5903dcbc0a39312feb77df2ff4c76387d591b9fc7b04a238dcf8bb62639a" dependencies = [ "android-tzdata", "iana-time-zone", @@ -1569,9 +1575,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.1" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c918d541ef2913577a0f9566e9ce27cb35b6df072075769e0b26cb5a554520da" +checksum = "b230ab84b0ffdf890d5a10abdbc8b83ae1c4918275daea1ab8801f71536b2651" dependencies = [ "clap_builder", "clap_derive", @@ -1579,9 +1585,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.1" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f3e7391dad68afb0c2ede1bf619f579a3dc9c2ec67f089baa397123a2f3d1eb" +checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" dependencies = [ "anstream", "anstyle", @@ -2604,7 +2610,7 @@ dependencies = [ "errno", "fix-hidden-lifetime-bug", "futures", - "hashbrown 0.14.2", + "hashbrown 0.12.3", "indexmap 2.2.5", "itertools 0.12.0", "lazy_static", @@ -3039,9 +3045,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c012a26a7f605efc424dd53697843a72be7dc86ad2d01f7814337794a12231d" +checksum = "38b35839ba51819680ba087cd351788c9a3c476841207e0b8cee0b04722343b9" dependencies = [ "anstream", "anstyle", @@ -4593,9 +4599,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "logutil" @@ -5320,9 +5326,9 @@ dependencies = [ [[package]] name = "object_store" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d139f545f64630e2e3688fd9f81c470888ab01edeb72d13b4e86c566f1130000" +checksum = "b8718f8b65fdf67a45108d1548347d4af7d71fb81ce727bbf9e3b2535e079db3" dependencies = [ "async-trait", "base64 0.21.7", @@ -5332,13 +5338,14 @@ dependencies = [ "humantime", "hyper", "itertools 0.12.0", + "md-5 0.10.6", "parking_lot", "percent-encoding", "quick-xml", "rand", "reqwest", "ring 0.17.8", - "rustls-pemfile 2.1.0", + "rustls-pemfile 2.1.1", "serde", "serde_json", "snafu", @@ -5692,7 +5699,7 @@ dependencies = [ "proxyutil", "reqwest", "rustls 0.21.10", - "rustls-pemfile 2.1.0", + "rustls-pemfile 2.1.1", "serde", "sqlexec", "tempfile", @@ -6424,9 +6431,9 @@ dependencies = [ [[package]] name = "reedline" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e01ebfbdb1a88963121d3c928c97be7f10fec7795bec8b918c8cda1db7c29e6" +checksum = "413a9fa6a5d8c937d3ae1e975bfb6a918bb0b6cdfae6a10416218c837a31b8fc" dependencies = [ "chrono", "crossterm", @@ -6696,7 +6703,7 @@ version = "0.9.1" dependencies = [ "arrow-flight", "async-trait", - "base64 0.21.7", + "base64 0.22.0", "bytes", "dashmap", "datafusion", @@ -7031,9 +7038,9 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c333bb734fcdedcea57de1602543590f545f127dc8b533324318fd492c5c70b" +checksum = "f48172685e6ff52a556baa527774f61fcaa884f59daf3375c62a3f1cd2549dab" dependencies = [ "base64 0.21.7", "rustls-pki-types", @@ -7703,7 +7710,7 @@ checksum = "5e9f0ab6ef7eb7353d9119c170a436d1bf248eea575ac42d19d12f4e34130831" name = "snowflake_connector" version = "0.9.1" dependencies = [ - "base64 0.21.7", + "base64 0.22.0", "bytes", "chrono", "datafusion", @@ -9042,9 +9049,9 @@ dependencies = [ [[package]] name = "walkdir" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", diff --git a/Cargo.toml b/Cargo.toml index bc8d98e4b..05d4da44b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ strip = true wildcard_imports = "deny" [workspace.dependencies] -clap = { version = "4.5.1", features = ["derive"] } +clap = { version = "4.5.2", features = ["derive"] } datafusion = { version = "35.0.0", features = ["avro"] } arrow-flight = { version = "50.0.0", features = ["flight-sql-experimental"] } datafusion-proto = { version = "35.0.0" } @@ -30,7 +30,7 @@ tokio = { version = "1", features = ["full"] } tonic = { version = "0.10", features = ["transport", "tls", "tls-roots"] } anyhow = "1.0.80" async-trait = "0.1.77" -chrono = "0.4.34" +chrono = "0.4.35" futures = "0.3.30" object_store = "0.9" prost = "0.12" diff --git a/crates/datasources/src/cassandra/builder.rs b/crates/datasources/src/cassandra/builder.rs index c5ec08124..236188f7e 100644 --- a/crates/datasources/src/cassandra/builder.rs +++ b/crates/datasources/src/cassandra/builder.rs @@ -177,7 +177,8 @@ impl CqlValueArrayBuilder { (Int64(builder), CqlValue::BigInt(value)) => builder.append_value(value), (Date64(builder), CqlValue::Date(value)) => { let days_since_unix_epoch = value.0 as i64 - (1 << 31); - let duration_since_unix_epoch = chrono::Duration::days(days_since_unix_epoch); + let duration_since_unix_epoch = + chrono::Duration::try_days(days_since_unix_epoch).unwrap(); let unix_epoch = chrono::NaiveDate::from_yo_opt(1970, 1).unwrap(); let date = unix_epoch + duration_since_unix_epoch; let time = NaiveTime::from_hms_opt(0, 0, 0).unwrap(); // Midnight diff --git a/crates/datasources/src/common/util.rs b/crates/datasources/src/common/util.rs index ef1b796e8..4d66b09c8 100644 --- a/crates/datasources/src/common/util.rs +++ b/crates/datasources/src/common/util.rs @@ -117,7 +117,9 @@ pub fn encode_literal_to_text( ScalarValue::Date32(Some(v)) => { let epoch = Utc.timestamp_nanos(0).naive_utc().date(); let naive = epoch - .checked_add_signed(Duration::days(*v as i64)) + .checked_add_signed(Duration::try_days(*v as i64).ok_or_else(|| { + DatasourceCommonError::Unsupported("timestamp conversion error") + })?) .expect("scalar value should be a valid date"); encode_date(buf, &naive)?; } diff --git a/crates/datasources/src/excel/mod.rs b/crates/datasources/src/excel/mod.rs index 4593285f3..1ff898476 100644 --- a/crates/datasources/src/excel/mod.rs +++ b/crates/datasources/src/excel/mod.rs @@ -151,7 +151,7 @@ fn xlsx_sheet_value_to_record_batch( let mut arr = Date64Array::builder(rows.len()); for r in rows { if let Some(v) = r.get(i).and_then(|v| v.as_datetime()) { - let v = v.timestamp_millis(); + let v = v.and_utc().timestamp_millis(); arr.append_value(v); } else { arr.append_null(); diff --git a/crates/datasources/src/mysql/mod.rs b/crates/datasources/src/mysql/mod.rs index e5b83d84a..6581493c9 100644 --- a/crates/datasources/src/mysql/mod.rs +++ b/crates/datasources/src/mysql/mod.rs @@ -717,7 +717,7 @@ fn mysql_row_to_record_batch(rows: Vec, schema: ArrowSchemaRef) -> Res for row in rows.iter() { let val: Option = row.get_opt(col_idx).expect("row value should exist")?; - let val = val.map(|v| v.timestamp_nanos_opt().unwrap()); + let val = val.and_then(|v| v.and_utc().timestamp_nanos_opt()); arr.append_option(val); } Arc::new(arr.finish()) @@ -727,7 +727,7 @@ fn mysql_row_to_record_batch(rows: Vec, schema: ArrowSchemaRef) -> Res for row in rows.iter() { let val: Option = row.get_opt(col_idx).expect("row value should exist")?; - let val = val.map(|v| v.timestamp_nanos_opt().unwrap()); + let val = val.and_then(|v| v.and_utc().timestamp_nanos_opt()); arr.append_option(val); } Arc::new(arr.finish()) diff --git a/crates/datasources/src/postgres/mod.rs b/crates/datasources/src/postgres/mod.rs index f86ce8e5b..9395cc1a0 100644 --- a/crates/datasources/src/postgres/mod.rs +++ b/crates/datasources/src/postgres/mod.rs @@ -1170,7 +1170,7 @@ fn binary_rows_to_record_batch>( let mut arr = TimestampMicrosecondBuilder::with_capacity(rows.len()); for row in rows.iter() { let val: Option = row.try_get(col_idx)?; - let val = val.map(|v| v.timestamp_micros()); + let val = val.map(|v| v.and_utc().timestamp_micros()); arr.append_option(val); } Arc::new(arr.finish()) diff --git a/crates/datasources/src/sqlite/convert.rs b/crates/datasources/src/sqlite/convert.rs index 1f6ae8227..50bbf67c5 100644 --- a/crates/datasources/src/sqlite/convert.rs +++ b/crates/datasources/src/sqlite/convert.rs @@ -1,6 +1,6 @@ use async_sqlite::rusqlite::types::{Value, ValueRef}; use async_sqlite::rusqlite::Rows; -use chrono::{NaiveDate, NaiveDateTime, NaiveTime}; +use chrono::{DateTime, NaiveDate, NaiveDateTime, NaiveTime}; use datafusion::arrow::array::{ ArrayBuilder, BinaryBuilder, @@ -419,24 +419,22 @@ impl Converter { match val_ref { ValueRef::Null => builder.append_null(), ValueRef::Integer(i) => { - let timestamp = - NaiveDateTime::from_timestamp_opt(i, /* nsecs = */ 0) - .ok_or_else(|| SqliteError::InvalidConversion { - from: Value::Integer(i), - to: DataType::Timestamp(TimeUnit::Microsecond, None), - })?; + let timestamp = DateTime::from_timestamp(i, /* nsecs = */ 0) + .ok_or_else(|| SqliteError::InvalidConversion { + from: Value::Integer(i), + to: DataType::Timestamp(TimeUnit::Microsecond, None), + })?; let micros = timestamp.timestamp_micros(); builder.append_value(micros); } ValueRef::Real(r) => { let seconds = r as i64; let sub_nanos = (r.fract() * 1_000_000_000_f64) as u32; - let timestamp = - NaiveDateTime::from_timestamp_opt(seconds, sub_nanos) - .ok_or_else(|| SqliteError::InvalidConversion { - from: Value::Real(r), - to: DataType::Timestamp(TimeUnit::Microsecond, None), - })?; + let timestamp = DateTime::from_timestamp(seconds, sub_nanos) + .ok_or_else(|| SqliteError::InvalidConversion { + from: Value::Real(r), + to: DataType::Timestamp(TimeUnit::Microsecond, None), + })?; let micros = timestamp.timestamp_micros(); builder.append_value(micros); } @@ -454,7 +452,7 @@ impl Converter { from: Value::Text(t.to_string()), to: DataType::Timestamp(TimeUnit::Microsecond, None), })?; - let micros = timestamp.timestamp_micros(); + let micros = timestamp.and_utc().timestamp_micros(); builder.append_value(micros); } v => { diff --git a/crates/datasources/src/sqlserver/mod.rs b/crates/datasources/src/sqlserver/mod.rs index 75831ec5b..d567482ec 100644 --- a/crates/datasources/src/sqlserver/mod.rs +++ b/crates/datasources/src/sqlserver/mod.rs @@ -743,7 +743,7 @@ fn rows_to_record_batch( let mut arr = TimestampNanosecondBuilder::with_capacity(rows.len()); for row in rows.iter() { let val: Option = row.try_get(col_idx)?; - let val = val.map(|v| v.timestamp_nanos_opt().unwrap()); + let val = val.and_then(|v| v.and_utc().timestamp_nanos_opt()); arr.append_option(val); } Arc::new(arr.finish()) @@ -753,7 +753,7 @@ fn rows_to_record_batch( .with_data_type(dt.clone()); for row in rows.iter() { let val: Option> = row.try_get(col_idx)?; - let val = val.map(|v| v.timestamp_nanos_opt().unwrap()); + let val = val.and_then(|v| v.timestamp_nanos_opt()); arr.append_option(val); } Arc::new(arr.finish()) diff --git a/crates/glaredb/Cargo.toml b/crates/glaredb/Cargo.toml index 5e821612a..b6e8cbc43 100644 --- a/crates/glaredb/Cargo.toml +++ b/crates/glaredb/Cargo.toml @@ -41,7 +41,7 @@ terminal_util = { path = "../terminal_util" } num_cpus = "1.16.0" colored = "2.1.0" -reedline = "0.29.0" +reedline = "0.30.0" nu-ansi-term = "0.50.0" atty = "0.2.14" console-subscriber = "0.2.0" diff --git a/crates/pgrepr/src/scalar.rs b/crates/pgrepr/src/scalar.rs index f09c7b599..7b7c9a61a 100644 --- a/crates/pgrepr/src/scalar.rs +++ b/crates/pgrepr/src/scalar.rs @@ -160,16 +160,20 @@ impl Scalar { DfScalar::Utf8(Some(v)) => Self::Text(v), DfScalar::Binary(Some(v)) => Self::Bytea(v), DfScalar::TimestampSecond(Some(v), None) => { - Self::Timestamp(NaiveDateTime::from_timestamp_opt(v, /* nsecs = */ 0).unwrap()) + Self::Timestamp( + DateTime::from_timestamp(v, /* nsecs = */ 0) + .unwrap() + .naive_utc(), + ) } DfScalar::TimestampMillisecond(Some(v), None) => { - Self::Timestamp(NaiveDateTime::from_timestamp_millis(v).unwrap()) + Self::Timestamp(DateTime::from_timestamp_millis(v).unwrap().naive_utc()) } DfScalar::TimestampMicrosecond(Some(v), None) => { - Self::Timestamp(NaiveDateTime::from_timestamp_micros(v).unwrap()) + Self::Timestamp(DateTime::from_timestamp_micros(v).unwrap().naive_utc()) } DfScalar::TimestampNanosecond(Some(v), None) => { - Self::Timestamp(NaiveDateTime::from_timestamp_nanos(v).unwrap()) + Self::Timestamp(DateTime::from_timestamp_nanos(v).naive_utc()) } DfScalar::TimestampSecond(Some(v), Some(tz)) => { Self::TimestampTz(get_timezone(&tz).timestamp_opt(v, /* nsecs = */ 0).unwrap()) @@ -184,25 +188,23 @@ impl Scalar { Self::TimestampTz(get_timezone(&tz).timestamp_nanos(v)) } DfScalar::Time32Second(Some(v)) => Self::Time( - NaiveDateTime::from_timestamp_opt(v as i64, /* nsecs = */ 0) - .unwrap() - .time(), - ), - DfScalar::Time32Millisecond(Some(v)) => Self::Time( - NaiveDateTime::from_timestamp_millis(v as i64) + DateTime::from_timestamp(v as i64, /* nsecs = */ 0) .unwrap() .time(), ), + DfScalar::Time32Millisecond(Some(v)) => { + Self::Time(DateTime::from_timestamp_millis(v as i64).unwrap().time()) + } DfScalar::Time64Microsecond(Some(v)) => { - Self::Time(NaiveDateTime::from_timestamp_micros(v).unwrap().time()) + Self::Time(DateTime::from_timestamp_micros(v).unwrap().time()) } DfScalar::Time64Nanosecond(Some(v)) => { - Self::Time(NaiveDateTime::from_timestamp_nanos(v).unwrap().time()) + Self::Time(DateTime::from_timestamp_nanos(v).time()) } DfScalar::Date32(Some(v)) => { let epoch = NaiveDate::from_ymd_opt(1970, 1, 1).unwrap(); let naive_date = epoch - .checked_add_signed(Duration::days(v as i64)) + .checked_add_signed(Duration::try_days(v as i64).unwrap()) .expect("scalar value should be a valid date"); Self::Date(naive_date) } @@ -235,17 +237,16 @@ impl Scalar { (Self::Text(v), ArrowType::Utf8) => DfScalar::Utf8(Some(v)), (Self::Bytea(v), ArrowType::Binary) => DfScalar::Binary(Some(v)), (Self::Timestamp(v), ArrowType::Timestamp(TimeUnit::Second, None)) => { - DfScalar::TimestampSecond(Some(v.timestamp()), None) + DfScalar::TimestampSecond(Some(v.second() as i64), None) } (Self::Timestamp(v), ArrowType::Timestamp(TimeUnit::Millisecond, None)) => { - DfScalar::TimestampMillisecond(Some(v.timestamp_millis()), None) + DfScalar::TimestampMillisecond(Some(v.and_utc().timestamp_millis()), None) } (Self::Timestamp(v), ArrowType::Timestamp(TimeUnit::Microsecond, None)) => { - DfScalar::TimestampMicrosecond(Some(v.timestamp_micros()), None) + DfScalar::TimestampMicrosecond(Some(v.and_utc().timestamp_micros()), None) } (Self::Timestamp(v), ArrowType::Timestamp(TimeUnit::Nanosecond, None)) => { - let nanos = v.timestamp_nanos_opt().unwrap(); - DfScalar::TimestampNanosecond(Some(nanos), None) + DfScalar::TimestampNanosecond(v.and_utc().timestamp_nanos_opt(), None) } ( Self::TimestampTz(v), diff --git a/crates/pgrepr/src/writer.rs b/crates/pgrepr/src/writer.rs index b7fdd766b..c5e4f88fd 100644 --- a/crates/pgrepr/src/writer.rs +++ b/crates/pgrepr/src/writer.rs @@ -331,7 +331,7 @@ mod tests { assert_buf(buf, b"\\x170dff0082"); buf.clear(); - let nt = NaiveDateTime::from_timestamp_opt(938689324, 0).unwrap(); + let nt = DateTime::from_timestamp(938689324, 0).unwrap().naive_utc(); Writer::write_timestamp(buf, &nt).unwrap(); assert_buf( buf, @@ -339,7 +339,9 @@ mod tests { ); buf.clear(); - let nt = NaiveDateTime::from_timestamp_opt(938689324, 123567).unwrap(); + let nt = DateTime::from_timestamp(938689324, 123567) + .unwrap() + .naive_utc(); Writer::write_timestamp(buf, &nt).unwrap(); assert_buf( buf, @@ -347,7 +349,9 @@ mod tests { ); buf.clear(); - let nt = NaiveDateTime::from_timestamp_opt(938689324, 123_400_000).unwrap(); + let nt = DateTime::from_timestamp(938689324, 123_400_000) + .unwrap() + .naive_utc(); Writer::write_timestamp(buf, &nt).unwrap(); assert_buf( buf, @@ -355,7 +359,7 @@ mod tests { ); buf.clear(); - let nt = NaiveDateTime::from_timestamp_opt(-197199051, 0).unwrap(); + let nt = DateTime::from_timestamp(-197199051, 0).unwrap().naive_utc(); Writer::write_timestamp(buf, &nt).unwrap(); assert_buf( buf, @@ -363,7 +367,9 @@ mod tests { ); buf.clear(); - let nt = NaiveDateTime::from_timestamp_opt(-62143593684, 0).unwrap(); + let nt = DateTime::from_timestamp(-62143593684, 0) + .unwrap() + .naive_utc(); Writer::write_timestamp(buf, &nt).unwrap(); assert_buf( buf, @@ -490,7 +496,9 @@ mod tests { assert_buf(buf, &[23, 13, 255, 0, 130]); buf.clear(); - let nt = NaiveDateTime::from_timestamp_opt(938689324, 123567).unwrap(); + let nt = DateTime::from_timestamp(938689324, 123567) + .unwrap() + .naive_utc(); Writer::write_timestamp(buf, &nt).unwrap(); // Microseconds since Jan 1, 2000 assert_buf(buf, (-7_995_475_999_876_i64).to_be_bytes().as_ref()); diff --git a/crates/pgsrv/Cargo.toml b/crates/pgsrv/Cargo.toml index 0c7f62dc7..352193aa0 100644 --- a/crates/pgsrv/Cargo.toml +++ b/crates/pgsrv/Cargo.toml @@ -25,7 +25,7 @@ bytes = "1.4.0" rustls = "0.21.10" webpki-roots = "0.26.1" tokio-rustls = "0.24.1" -rustls-pemfile = "2.1.0" +rustls-pemfile = "2.1.1" tokio-util = { version = "0.7.10", features = ["codec"] } tokio-postgres = "0.7.8" uuid = { version = "1.7.0", features = ["v4", "fast-rng", "macro-diagnostics"] } diff --git a/crates/repr/src/str/encode.rs b/crates/repr/src/str/encode.rs index 5f3b45a52..95f4de707 100644 --- a/crates/repr/src/str/encode.rs +++ b/crates/repr/src/str/encode.rs @@ -237,7 +237,7 @@ where #[cfg(test)] mod tests { - use chrono::{NaiveDate, NaiveDateTime, NaiveTime, TimeZone, Utc}; + use chrono::{DateTime, NaiveDate, NaiveTime, TimeZone, Utc}; use decimal::Decimal128; use super::*; @@ -310,7 +310,7 @@ mod tests { &[23, 13, 255, 0, 130], ); - let nt = NaiveDateTime::from_timestamp_opt(938689324, 0).unwrap(); + let nt = DateTime::from_timestamp(938689324, 0).unwrap().naive_utc(); assert_encode!( nt.format("%Y-%m-%d %H:%M:%S"), encode_utc_timestamp, @@ -318,7 +318,9 @@ mod tests { false, ); - let nt = NaiveDateTime::from_timestamp_opt(938689324, 123567).unwrap(); + let nt = DateTime::from_timestamp(938689324, 123567) + .unwrap() + .naive_utc(); assert_encode!( format!("{}.000124", nt.format("%Y-%m-%d %H:%M:%S")), encode_utc_timestamp, @@ -326,7 +328,9 @@ mod tests { false, ); - let nt = NaiveDateTime::from_timestamp_opt(938689324, 123_400_000).unwrap(); + let nt = DateTime::from_timestamp(938689324, 123_400_000) + .unwrap() + .naive_utc(); assert_encode!( format!("{}.1234", nt.format("%Y-%m-%d %H:%M:%S")), encode_utc_timestamp, @@ -334,7 +338,7 @@ mod tests { false, ); - let nt = NaiveDateTime::from_timestamp_opt(-197199051, 0).unwrap(); + let nt = DateTime::from_timestamp(-197199051, 0).unwrap().naive_utc(); assert_encode!( nt.format("%Y-%m-%d %H:%M:%S"), encode_utc_timestamp, @@ -342,7 +346,9 @@ mod tests { false, ); - let nt = NaiveDateTime::from_timestamp_opt(-62143593684, 0).unwrap(); + let nt = DateTime::from_timestamp(-62143593684, 0) + .unwrap() + .naive_utc(); assert_encode!( format!("1-{} BC", nt.format("%m-%d %H:%M:%S")), encode_utc_timestamp, diff --git a/crates/rpcsrv/Cargo.toml b/crates/rpcsrv/Cargo.toml index bec232ca8..a3ca59254 100644 --- a/crates/rpcsrv/Cargo.toml +++ b/crates/rpcsrv/Cargo.toml @@ -26,7 +26,7 @@ sqlexec = { path = "../sqlexec" } telemetry = { path = "../telemetry" } -base64 = "0.21.7" +base64 = "0.22.0" bytes = "1.4" dashmap = "5.5.0" once_cell = "1.19.0" diff --git a/crates/slt/Cargo.toml b/crates/slt/Cargo.toml index dc0008011..a732df5b1 100644 --- a/crates/slt/Cargo.toml +++ b/crates/slt/Cargo.toml @@ -32,5 +32,5 @@ glob = "0.3.1" regex = "1.10.3" sqllogictest = "0.19.1" uuid = { version = "1.7", features = ["v4", "fast-rng", "macro-diagnostics"] } -walkdir = "2.3.3" +walkdir = "2.5.0" once_cell = "1.19.0" diff --git a/crates/snowflake_connector/Cargo.toml b/crates/snowflake_connector/Cargo.toml index 0c2a80875..fb0446c98 100644 --- a/crates/snowflake_connector/Cargo.toml +++ b/crates/snowflake_connector/Cargo.toml @@ -16,7 +16,7 @@ chrono = { workspace = true } uuid = { version = "1.7.0", features = ["v4", "fast-rng", "macro-diagnostics"] } datafusion = { workspace = true } hex = "0.4.3" -base64 = "0.21.7" +base64 = "0.22.0" bytes = "1.4.0" flate2 = "1.0.28" decimal = { path = "../decimal" } diff --git a/crates/snowflake_connector/src/auth.rs b/crates/snowflake_connector/src/auth.rs index 9eda07ae5..a41106317 100644 --- a/crates/snowflake_connector/src/auth.rs +++ b/crates/snowflake_connector/src/auth.rs @@ -19,7 +19,7 @@ impl Token { pub fn new(value: String, validity_in_seconds: i64, created_at: DateTime) -> Self { Self { value, - validity: Duration::seconds(validity_in_seconds), + validity: Duration::try_seconds(validity_in_seconds).unwrap(), created_at, } } diff --git a/crates/sqlbuiltins/Cargo.toml b/crates/sqlbuiltins/Cargo.toml index 33372d1b1..05e55f377 100644 --- a/crates/sqlbuiltins/Cargo.toml +++ b/crates/sqlbuiltins/Cargo.toml @@ -30,7 +30,7 @@ kdl = "5.0.0-alpha.1" siphasher = "1.0.0" fnv = "1.0.7" memoize = { version = "0.4.2", features = ["full"] } -async-openai = "0.18.3" +async-openai = "0.19.0" tokio.workspace = true reqwest.workspace = true # Important to keep this in sync with the datafusion arrow-cast version