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

[Rust] Expose JsonSchema struct as public struct #1070

Merged
merged 3 commits into from
Jul 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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