Skip to content

Commit

Permalink
[Rust] Expose JsonSchema struct as public struct (#1070)
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyxu authored Jul 15, 2023
1 parent 85aa42a commit 1c331b5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
5 changes: 2 additions & 3 deletions rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion rust/src/arrow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion rust/src/arrow/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<JsonField>,

#[serde(skip_serializing_if = "Option::is_none")]
Expand Down

0 comments on commit 1c331b5

Please sign in to comment.