From 679961310982505a80ead09e645a9dcf9de1f782 Mon Sep 17 00:00:00 2001 From: Lei Xu Date: Thu, 7 Sep 2023 17:01:45 -0700 Subject: [PATCH] feat: upgrade lance to 0.7.3 (#481) --- Cargo.toml | 2 +- python/pyproject.toml | 2 +- rust/ffi/node/src/arrow.rs | 4 +++- rust/ffi/node/src/lib.rs | 8 +++----- rust/ffi/node/src/table.rs | 22 ++++++++++------------ 5 files changed, 18 insertions(+), 20 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8905a303..7ba4d995 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ exclude = ["python"] resolver = "2" [workspace.dependencies] -lance = "=0.6.5" +lance = "=0.7.3" # Note that this one does not include pyarrow arrow = { version = "43.0.0", optional = false } arrow-array = "43.0" diff --git a/python/pyproject.toml b/python/pyproject.toml index 6b33e348..156c1e16 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -2,7 +2,7 @@ name = "lancedb" version = "0.2.2" dependencies = [ - "pylance==0.6.5", + "pylance==0.7.3", "ratelimiter", "retry", "tqdm", diff --git a/rust/ffi/node/src/arrow.rs b/rust/ffi/node/src/arrow.rs index 0d1021f5..58ca62da 100644 --- a/rust/ffi/node/src/arrow.rs +++ b/rust/ffi/node/src/arrow.rs @@ -28,7 +28,9 @@ fn validate_vector_column(record_batch: &RecordBatch) -> Result<()> { record_batch .column_by_name(VECTOR_COLUMN_NAME) .map(|_| ()) - .context(MissingColumnSnafu { name: VECTOR_COLUMN_NAME }) + .context(MissingColumnSnafu { + name: VECTOR_COLUMN_NAME, + }) } pub(crate) fn arrow_buffer_to_record_batch(slice: &[u8]) -> Result<(Vec, SchemaRef)> { diff --git a/rust/ffi/node/src/lib.rs b/rust/ffi/node/src/lib.rs index 6791bc69..fcb8fe76 100644 --- a/rust/ffi/node/src/lib.rs +++ b/rust/ffi/node/src/lib.rs @@ -183,11 +183,9 @@ fn database_open_table(mut cx: FunctionContext) -> JsResult { let aws_region = get_aws_region(&mut cx, 4)?; let params = ReadParams { - store_options: Some(ObjectStoreParams { - aws_credentials: aws_creds, - aws_region, - ..ObjectStoreParams::default() - }), + store_options: Some(ObjectStoreParams::with_aws_credentials( + aws_creds, aws_region, + )), ..ReadParams::default() }; diff --git a/rust/ffi/node/src/table.rs b/rust/ffi/node/src/table.rs index 0d7bf3e3..0363dc2a 100644 --- a/rust/ffi/node/src/table.rs +++ b/rust/ffi/node/src/table.rs @@ -43,7 +43,8 @@ impl JsTable { .downcast_or_throw::, _>(&mut cx)?; let table_name = cx.argument::(0)?.value(&mut cx); let buffer = cx.argument::(1)?; - let (batches, schema) = arrow_buffer_to_record_batch(buffer.as_slice(&mut cx)).or_throw(&mut cx)?; + let (batches, schema) = + arrow_buffer_to_record_batch(buffer.as_slice(&mut cx)).or_throw(&mut cx)?; // Write mode let mode = match cx.argument::(2)?.value(&mut cx).as_str() { @@ -65,11 +66,9 @@ impl JsTable { let aws_region = get_aws_region(&mut cx, 6)?; let params = WriteParams { - store_params: Some(ObjectStoreParams { - aws_credentials: aws_creds, - aws_region, - ..ObjectStoreParams::default() - }), + store_params: Some(ObjectStoreParams::with_aws_credentials( + aws_creds, aws_region, + )), mode: mode, ..WriteParams::default() }; @@ -92,7 +91,8 @@ impl JsTable { let js_table = cx.this().downcast_or_throw::, _>(&mut cx)?; let buffer = cx.argument::(0)?; let write_mode = cx.argument::(1)?.value(&mut cx); - let (batches, schema) = arrow_buffer_to_record_batch(buffer.as_slice(&mut cx)).or_throw(&mut cx)?; + let (batches, schema) = + arrow_buffer_to_record_batch(buffer.as_slice(&mut cx)).or_throw(&mut cx)?; let rt = runtime(&mut cx)?; let channel = cx.channel(); let mut table = js_table.table.clone(); @@ -108,11 +108,9 @@ impl JsTable { let aws_region = get_aws_region(&mut cx, 5)?; let params = WriteParams { - store_params: Some(ObjectStoreParams { - aws_credentials: aws_creds, - aws_region, - ..ObjectStoreParams::default() - }), + store_params: Some(ObjectStoreParams::with_aws_credentials( + aws_creds, aws_region, + )), mode: write_mode, ..WriteParams::default() };