From 60b83d9362191d54407ad6cbc56164a20d7cedf9 Mon Sep 17 00:00:00 2001 From: Lei Xu Date: Fri, 14 Jul 2023 20:51:28 -0700 Subject: [PATCH 1/3] expose JsonSchema --- rust/src/arrow/json.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rust/src/arrow/json.rs b/rust/src/arrow/json.rs index 6726e3342b..a22d452834 100644 --- a/rust/src/arrow/json.rs +++ b/rust/src/arrow/json.rs @@ -206,8 +206,9 @@ impl TryFrom<&JsonField> for Field { } } +/// JSON representation of a Apache Arrow [Schema]. #[derive(Serialize, Deserialize, Debug)] -struct JsonSchema { +pub struct JsonSchema { fields: Vec, #[serde(skip_serializing_if = "Option::is_none")] From c8df71c7c140f72536216840f93f92ba5d8fd728 Mon Sep 17 00:00:00 2001 From: Lei Xu Date: Fri, 14 Jul 2023 20:53:51 -0700 Subject: [PATCH 2/3] do not make json optional --- rust/Cargo.toml | 5 ++--- rust/src/arrow.rs | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/rust/Cargo.toml b/rust/Cargo.toml index c755e32be4..a0a12f9a60 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -73,8 +73,8 @@ num-traits = "0.2" ordered-float = "3.6.0" snafu = "0.7.4" log = "0" -serde_json = { version = "1", optional = true } -serde = { version = "^1", optional = true } +serde_json = { version = "1" } +serde = { version = "^1" } [target.'cfg(target_os = "macos")'.dependencies] accelerate-src = { version = "0.3.2", optional = true } @@ -102,7 +102,6 @@ dirs = "5.0.0" [features] cli = ["clap"] opq = ["cblas", "lapack", "openblas-src", "accelerate-src"] -json = ["serde_json", "serde"] [[bin]] name = "lq" diff --git a/rust/src/arrow.rs b/rust/src/arrow.rs index 731d0a714a..e471e5e2c8 100644 --- a/rust/src/arrow.rs +++ b/rust/src/arrow.rs @@ -33,7 +33,6 @@ pub use kernels::*; pub mod schema; pub use schema::*; pub mod bfloat16; -#[cfg(feature = "json")] pub mod json; pub trait DataTypeExt { From 0de406b399ba03f5b7c84f8ff9fd2417f6a9357c Mon Sep 17 00:00:00 2001 From: Lei Xu Date: Fri, 14 Jul 2023 20:58:48 -0700 Subject: [PATCH 3/3] fix --- python/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/Cargo.toml b/python/Cargo.toml index 1b1286f7e6..9f1e61ccf8 100644 --- a/python/Cargo.toml +++ b/python/Cargo.toml @@ -19,7 +19,7 @@ chrono = "0.4.23" env_logger = "0.10" futures = "0.3" half = { version = "2.1", default-features = false, features = ["num-traits"] } -lance = { path = "../rust", features = ["json"] } +lance = { path = "../rust" } log = "0.4" prost = "0.11" pyo3 = { version = "0.19", features = ["extension-module", "abi3-py38"] }