From 1d4943688d649c534460bddf543f2b1a988e7a68 Mon Sep 17 00:00:00 2001 From: Will Jones Date: Wed, 20 Dec 2023 13:06:54 -0800 Subject: [PATCH] upgrade lance to v0.9.1 (#727) This brings in some important bugfixes related to take and aarch64 Linux. See changes at: https://github.com/lancedb/lance/releases/tag/v0.9.1 --- Cargo.toml | 26 +++++++++++++------------- python/pyproject.toml | 2 +- python/tests/test_table.py | 2 +- rust/vectordb/src/io/object_store.rs | 27 +++++++++++++++++++++------ 4 files changed, 36 insertions(+), 21 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4e1282e1..fb331eac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,24 +5,24 @@ exclude = ["python"] resolver = "2" [workspace.dependencies] -lance = { "version" = "=0.9.0", "features" = ["dynamodb"] } -lance-index = { "version" = "=0.9.0" } -lance-linalg = { "version" = "=0.9.0" } -lance-testing = { "version" = "=0.9.0" } +lance = { "version" = "=0.9.1", "features" = ["dynamodb"] } +lance-index = { "version" = "=0.9.1" } +lance-linalg = { "version" = "=0.9.1" } +lance-testing = { "version" = "=0.9.1" } # Note that this one does not include pyarrow -arrow = { version = "47.0.0", optional = false } -arrow-array = "47.0" -arrow-data = "47.0" -arrow-ipc = "47.0" -arrow-ord = "47.0" -arrow-schema = "47.0" -arrow-arith = "47.0" -arrow-cast = "47.0" +arrow = { version = "49.0.0", optional = false } +arrow-array = "49.0" +arrow-data = "49.0" +arrow-ipc = "49.0" +arrow-ord = "49.0" +arrow-schema = "49.0" +arrow-arith = "49.0" +arrow-cast = "49.0" chrono = "0.4.23" half = { "version" = "=2.3.1", default-features = false, features = [ "num-traits", ] } log = "0.4" -object_store = "0.7.1" +object_store = "0.8.0" snafu = "0.7.4" url = "2" diff --git a/python/pyproject.toml b/python/pyproject.toml index 6b2b1004..751e69ea 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -3,7 +3,7 @@ name = "lancedb" version = "0.4.0" dependencies = [ "deprecation", - "pylance==0.9.0", + "pylance==0.9.1", "ratelimiter~=1.0", "retry>=0.9.2", "tqdm>=4.27.0", diff --git a/python/tests/test_table.py b/python/tests/test_table.py index 3ed1eede..3ae193a9 100644 --- a/python/tests/test_table.py +++ b/python/tests/test_table.py @@ -21,8 +21,8 @@ import lance import numpy as np import pandas as pd import pyarrow as pa -from pydantic import BaseModel import pytest +from pydantic import BaseModel from lancedb.conftest import MockTextEmbeddingFunction from lancedb.db import LanceDBConnection diff --git a/rust/vectordb/src/io/object_store.rs b/rust/vectordb/src/io/object_store.rs index 21b4d60a..e323f9b9 100644 --- a/rust/vectordb/src/io/object_store.rs +++ b/rust/vectordb/src/io/object_store.rs @@ -26,7 +26,7 @@ use futures::{stream::BoxStream, FutureExt, StreamExt}; use lance::io::object_store::WrappingObjectStore; use object_store::{ path::Path, Error, GetOptions, GetResult, ListResult, MultipartId, ObjectMeta, ObjectStore, - Result, + PutOptions, PutResult, Result, }; use async_trait::async_trait; @@ -72,13 +72,28 @@ impl PrimaryOnly for Path { /// Note: this object store does not mirror writes to *.manifest files #[async_trait] impl ObjectStore for MirroringObjectStore { - async fn put(&self, location: &Path, bytes: Bytes) -> Result<()> { + async fn put(&self, location: &Path, bytes: Bytes) -> Result { if location.primary_only() { self.primary.put(location, bytes).await } else { self.secondary.put(location, bytes.clone()).await?; - self.primary.put(location, bytes).await?; - Ok(()) + self.primary.put(location, bytes).await + } + } + + async fn put_opts( + &self, + location: &Path, + bytes: Bytes, + options: PutOptions, + ) -> Result { + if location.primary_only() { + self.primary.put_opts(location, bytes, options).await + } else { + self.secondary + .put_opts(location, bytes.clone(), options.clone()) + .await?; + self.primary.put_opts(location, bytes, options).await } } @@ -129,8 +144,8 @@ impl ObjectStore for MirroringObjectStore { self.primary.delete(location).await } - async fn list(&self, prefix: Option<&Path>) -> Result>> { - self.primary.list(prefix).await + fn list(&self, prefix: Option<&Path>) -> BoxStream<'_, Result> { + self.primary.list(prefix) } async fn list_with_delimiter(&self, prefix: Option<&Path>) -> Result {