Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade dependencies #2769

Merged
merged 20 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
4c4c95f
chore(deps): bump object_store from 0.9.0 to 0.9.1
dependabot[bot] Mar 8, 2024
049eba0
chore(deps): bump async-openai from 0.18.3 to 0.19.0
dependabot[bot] Mar 8, 2024
c23053f
chore(deps): bump clap from 4.5.1 to 4.5.2
dependabot[bot] Mar 8, 2024
bfa2071
chore(deps): bump env_logger from 0.11.2 to 0.11.3
dependabot[bot] Mar 8, 2024
026c0a3
chore(deps): bump rustls-pemfile from 2.1.0 to 2.1.1
dependabot[bot] Mar 8, 2024
0fe5a48
chore(deps): bump chrono from 0.4.34 to 0.4.35
dependabot[bot] Mar 8, 2024
d0c403e
chore(deps): bump base64 from 0.21.7 to 0.22.0
dependabot[bot] Mar 8, 2024
400f496
chore(deps): bump reedline from 0.29.0 to 0.30.0
dependabot[bot] Mar 8, 2024
259ae94
chore(deps): bump walkdir from 2.4.0 to 2.5.0
dependabot[bot] Mar 8, 2024
725ad18
Merge remote-tracking branch 'origin/dependabot/cargo/reedline-0.30.0…
tychoish Mar 11, 2024
92d3a35
Merge remote-tracking branch 'origin/dependabot/cargo/base64-0.22.0' …
tychoish Mar 11, 2024
ccca523
Merge remote-tracking branch 'origin/dependabot/cargo/chrono-0.4.35' …
tychoish Mar 11, 2024
a6f7a68
Merge remote-tracking branch 'origin/dependabot/cargo/rustls-pemfile-…
tychoish Mar 11, 2024
9629c81
Merge remote-tracking branch 'origin/dependabot/cargo/env_logger-0.11…
tychoish Mar 11, 2024
7f5e62b
Merge remote-tracking branch 'origin/dependabot/cargo/clap-4.5.2' int…
tychoish Mar 11, 2024
1c146a6
Merge remote-tracking branch 'origin/dependabot/cargo/async-openai-0.…
tychoish Mar 11, 2024
9d6b6e5
Merge remote-tracking branch 'origin/dependabot/cargo/object_store-0.…
tychoish Mar 11, 2024
f31f6ee
fixup time handling
tychoish Mar 11, 2024
d469aed
test compile fixes
tychoish Mar 11, 2024
87f2c45
fmt
tychoish Mar 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 32 additions & 25 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand All @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion crates/datasources/src/cassandra/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion crates/datasources/src/common/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;
}
Expand Down
2 changes: 1 addition & 1 deletion crates/datasources/src/excel/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions crates/datasources/src/mysql/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ fn mysql_row_to_record_batch(rows: Vec<MysqlRow>, schema: ArrowSchemaRef) -> Res
for row in rows.iter() {
let val: Option<NaiveDateTime> =
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())
Expand All @@ -727,7 +727,7 @@ fn mysql_row_to_record_batch(rows: Vec<MysqlRow>, schema: ArrowSchemaRef) -> Res
for row in rows.iter() {
let val: Option<NaiveDateTime> =
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())
Expand Down
2 changes: 1 addition & 1 deletion crates/datasources/src/postgres/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,7 @@ fn binary_rows_to_record_batch<E: Into<PostgresError>>(
let mut arr = TimestampMicrosecondBuilder::with_capacity(rows.len());
for row in rows.iter() {
let val: Option<NaiveDateTime> = 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())
Expand Down
26 changes: 12 additions & 14 deletions crates/datasources/src/sqlite/convert.rs
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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);
}
Expand All @@ -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 => {
Expand Down
4 changes: 2 additions & 2 deletions crates/datasources/src/sqlserver/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<NaiveDateTime> = 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())
Expand All @@ -753,7 +753,7 @@ fn rows_to_record_batch(
.with_data_type(dt.clone());
for row in rows.iter() {
let val: Option<DateTime<Utc>> = 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())
Expand Down
2 changes: 1 addition & 1 deletion crates/glaredb/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading