diff --git a/Cargo.lock b/Cargo.lock index 9a424ddd30..edfa507a08 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3360,7 +3360,6 @@ dependencies = [ "num-bigint 0.3.2", "num-format", "num-traits 0.2.14", - "polars", "query_interface", "serde 1.0.126", "sha2 0.9.5", @@ -4450,9 +4449,9 @@ dependencies = [ [[package]] name = "polars" -version = "0.14.7" +version = "0.14.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c1bf71de63afed8a9262b61a2a7c3a463bf3b2b8dc28a91873621a86ddeb996" +checksum = "9ed1645f3daba885ecedef8a76839536bfc7263f1e4fc0b67b27282f19325756" dependencies = [ "polars-core", "polars-io", @@ -4461,9 +4460,9 @@ dependencies = [ [[package]] name = "polars-arrow" -version = "0.14.7" +version = "0.14.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1d436b455a6ac76f09b7b8127d2c4b21e80e8b7579218edee91ce138281d178" +checksum = "5943252213fbd21e26b62240f5bb73f5d874e1072ed93234c6860781a4c366f2" dependencies = [ "arrow", "num 0.4.0", @@ -4472,9 +4471,9 @@ dependencies = [ [[package]] name = "polars-core" -version = "0.14.7" +version = "0.14.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3e1a74ab0ddbb0cca4f9a79691cf419ec7af63fc1f72206fac6ab45508d6d85" +checksum = "df43d51c6314623deafdd1266ca9a8431f087d9d345fffc8eeb16508aec69fee" dependencies = [ "ahash", "anyhow", @@ -4499,9 +4498,9 @@ dependencies = [ [[package]] name = "polars-io" -version = "0.14.7" +version = "0.14.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54f37bf032736512cc938000e937175b3bbfc27ea72abd07fc03d25145d709a0" +checksum = "cd998aab494826fb08d9c83763fc2925c9aa4eab2e4b349416bb174b9b300a3a" dependencies = [ "ahash", "anyhow", @@ -4525,9 +4524,9 @@ dependencies = [ [[package]] name = "polars-lazy" -version = "0.14.7" +version = "0.14.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c7f767d152af32f2880c02d0e4ead23d5591e066bf92af462ef9d1e4149e7af" +checksum = "6596b6d1cf1e378976ad9f5d2abe88ba08f112684ca1b67fbe89b97832c9f11d" dependencies = [ "ahash", "itertools", diff --git a/crates/nu-command/Cargo.toml b/crates/nu-command/Cargo.toml index ad3c43c2bf..a2dc7df9b5 100644 --- a/crates/nu-command/Cargo.toml +++ b/crates/nu-command/Cargo.toml @@ -99,7 +99,7 @@ zip = { version="0.5.9", optional=true } digest = "0.9.0" [dependencies.polars] -version = "0.14.7" +version = "0.14.8" optional = true features = ["parquet", "json", "random", "pivot", "strings", "is_in"] diff --git a/crates/nu-data/Cargo.toml b/crates/nu-data/Cargo.toml index e82a840bc5..946b4ccb0d 100644 --- a/crates/nu-data/Cargo.toml +++ b/crates/nu-data/Cargo.toml @@ -37,13 +37,8 @@ nu-test-support = { version = "0.34.1", path="../nu-test-support" } nu-value-ext = { version = "0.34.1", path="../nu-value-ext" } nu-ansi-term = { version = "0.34.1", path="../nu-ansi-term" } -[dependencies.polars] -version = "0.14.7" -optional = true -features = ["strings", "checked_arithmetic"] - [target.'cfg(unix)'.dependencies] users = "0.11.0" [features] -dataframe = ["nu-protocol/dataframe", "polars"] +dataframe = ["nu-protocol/dataframe"] diff --git a/crates/nu-data/src/lib.rs b/crates/nu-data/src/lib.rs index 60614f1589..44d0862bba 100644 --- a/crates/nu-data/src/lib.rs +++ b/crates/nu-data/src/lib.rs @@ -6,7 +6,4 @@ pub mod primitive; pub mod utils; pub mod value; -#[cfg(feature = "dataframe")] -pub mod dataframe; - pub use dict::TaggedListBuilder; diff --git a/crates/nu-engine/src/evaluate/operator.rs b/crates/nu-engine/src/evaluate/operator.rs index 0773462cf5..4cea18f20f 100644 --- a/crates/nu-engine/src/evaluate/operator.rs +++ b/crates/nu-engine/src/evaluate/operator.rs @@ -5,7 +5,7 @@ use nu_protocol::{Primitive, ShellTypeName, UntaggedValue, Value}; use std::ops::Not; #[cfg(feature = "dataframe")] -use nu_data::dataframe::{compute_between_dataframes, compute_series_single_value}; +use nu_protocol::dataframe::{compute_between_dataframes, compute_series_single_value}; pub fn apply_operator( op: Operator, diff --git a/crates/nu-protocol/Cargo.toml b/crates/nu-protocol/Cargo.toml index 12521b369c..fa5b51120b 100644 --- a/crates/nu-protocol/Cargo.toml +++ b/crates/nu-protocol/Cargo.toml @@ -32,9 +32,9 @@ serde_yaml = "0.8.16" toml = "0.5.8" [dependencies.polars] -version = "0.14.7" +version = "0.14.8" optional = true -features = ["serde", "rows"] +features = ["serde", "rows", "strings", "checked_arithmetic"] [features] dataframe = ["polars"] diff --git a/crates/nu-data/src/dataframe.rs b/crates/nu-protocol/src/dataframe/compute_between.rs similarity index 99% rename from crates/nu-data/src/dataframe.rs rename to crates/nu-protocol/src/dataframe/compute_between.rs index 813740ba85..ba1b1bff22 100644 --- a/crates/nu-data/src/dataframe.rs +++ b/crates/nu-protocol/src/dataframe/compute_between.rs @@ -1,11 +1,12 @@ use bigdecimal::BigDecimal; use nu_errors::ShellError; -use nu_protocol::dataframe::{Axis, NuDataFrame}; -use nu_protocol::hir::Operator; -use nu_protocol::{Primitive, ShellTypeName, UntaggedValue, Value}; use nu_source::Span; use num_traits::ToPrimitive; +use super::{Axis, NuDataFrame}; +use crate::hir::Operator; +use crate::{Primitive, ShellTypeName, UntaggedValue, Value}; + use polars::prelude::{ BooleanType, ChunkCompare, ChunkedArray, DataType, Float64Type, Int64Type, IntoSeries, NumOpsDispatchChecked, PolarsError, Series, diff --git a/crates/nu-protocol/src/dataframe/mod.rs b/crates/nu-protocol/src/dataframe/mod.rs index cd409d4491..94aa627051 100644 --- a/crates/nu-protocol/src/dataframe/mod.rs +++ b/crates/nu-protocol/src/dataframe/mod.rs @@ -1,7 +1,9 @@ +pub mod compute_between; pub mod nu_dataframe; pub mod nu_groupby; pub mod operations; +pub use compute_between::{compute_between_dataframes, compute_series_single_value}; pub use nu_dataframe::{Column, NuDataFrame}; pub use nu_groupby::NuGroupBy; pub use operations::Axis;