diff --git a/crates/nu-protocol/src/value/mod.rs b/crates/nu-protocol/src/value/mod.rs index 0aac797c8d..ad7f8fe546 100644 --- a/crates/nu-protocol/src/value/mod.rs +++ b/crates/nu-protocol/src/value/mod.rs @@ -3056,7 +3056,7 @@ impl Value { } } (Value::Custom { val: lhs, .. }, rhs) => { - lhs.operation(self.span(), Operator::Math(Math::Divide), op, rhs) + lhs.operation(self.span(), Operator::Math(Math::FloorDivide), op, rhs) } _ => Err(operator_type_error( Operator::Math(Math::FloorDivide), diff --git a/crates/nu_plugin_polars/Cargo.toml b/crates/nu_plugin_polars/Cargo.toml index 5e8b431487..5bdff452aa 100644 --- a/crates/nu_plugin_polars/Cargo.toml +++ b/crates/nu_plugin_polars/Cargo.toml @@ -23,18 +23,21 @@ nu-path = { path = "../nu-path", version = "0.103.1" } nu-utils = { path = "../nu-utils", version = "0.103.1" } # Potential dependencies for extras -chrono = { workspace = true, features = ["std", "unstable-locales"], default-features = false } +chrono = { workspace = true, features = [ + "std", + "unstable-locales", +], default-features = false } chrono-tz = "0.10" fancy-regex = { workspace = true } indexmap = { version = "2.9" } -num = {version = "0.4"} +num = { version = "0.4" } serde = { version = "1.0", features = ["derive"] } -sqlparser = { version = "0.53"} -polars-io = { version = "0.46", features = ["avro", "cloud", "aws"]} -polars-arrow = { version = "0.46"} -polars-ops = { version = "0.46", features = ["pivot", "cutqcut"]} -polars-plan = { version = "0.46", features = ["regex"]} -polars-utils = { version = "0.46"} +sqlparser = { version = "0.53" } +polars-io = { version = "0.46", features = ["avro", "cloud", "aws"] } +polars-arrow = { version = "0.46" } +polars-ops = { version = "0.46", features = ["pivot", "cutqcut"] } +polars-plan = { version = "0.46", features = ["regex"] } +polars-utils = { version = "0.46" } typetag = "0.2" env_logger = "0.11.3" log.workspace = true @@ -52,42 +55,43 @@ url.workspace = true [dependencies.polars] features = [ - "arg_where", - "bigidx", - "checked_arithmetic", - "cloud", - "concat_str", - "cross_join", - "csv", - "cum_agg", - "default", - "dtype-categorical", - "dtype-datetime", - "dtype-struct", - "dtype-decimal", - "dtype-i8", - "dtype-i16", - "dtype-u8", - "dtype-u16", - "dynamic_group_by", - "ipc", - "is_in", - "json", - "lazy", - "object", - "parquet", - "pivot", - "random", - "rolling_window", - "rows", - "serde", - "serde-lazy", - "strings", - "string_to_integer", - "streaming", - "timezones", - "temporal", - "to_dummies", + "arg_where", + "bigidx", + "checked_arithmetic", + "cloud", + "concat_str", + "cross_join", + "csv", + "cum_agg", + "default", + "dtype-categorical", + "dtype-datetime", + "dtype-struct", + "dtype-decimal", + "dtype-i8", + "dtype-i16", + "dtype-u8", + "dtype-u16", + "dynamic_group_by", + "ipc", + "is_in", + "json", + "lazy", + "object", + "parquet", + "pivot", + "random", + "rolling_window", + "rows", + "round_series", + "serde", + "serde-lazy", + "strings", + "string_to_integer", + "streaming", + "timezones", + "temporal", + "to_dummies", ] optional = false version = "0.46" diff --git a/crates/nu_plugin_polars/src/dataframe/values/nu_expression/custom_value.rs b/crates/nu_plugin_polars/src/dataframe/values/nu_expression/custom_value.rs index dc1db125ef..d028d513fa 100644 --- a/crates/nu_plugin_polars/src/dataframe/values/nu_expression/custom_value.rs +++ b/crates/nu_plugin_polars/src/dataframe/values/nu_expression/custom_value.rs @@ -101,7 +101,7 @@ fn with_operator( apply_arithmetic(plugin, engine, left, right, lhs_span, Rem::rem) } Operator::Math(Math::FloorDivide) => { - apply_arithmetic(plugin, engine, left, right, lhs_span, Div::div) + apply_arithmetic(plugin, engine, left, right, lhs_span, Expr::floor_div) } Operator::Math(Math::Pow) => { apply_arithmetic(plugin, engine, left, right, lhs_span, Expr::pow)