diff --git a/crates/nu_plugin_polars/Cargo.toml b/crates/nu_plugin_polars/Cargo.toml index 2590e63358..1b91d0d760 100644 --- a/crates/nu_plugin_polars/Cargo.toml +++ b/crates/nu_plugin_polars/Cargo.toml @@ -54,6 +54,7 @@ url.workspace = true [dependencies.polars] features = [ "arg_where", + "bigidx", "checked_arithmetic", "cloud", "concat_str", diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/first.rs b/crates/nu_plugin_polars/src/dataframe/command/data/first.rs index ca5205ff6a..552b173e5c 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/first.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/first.rs @@ -137,7 +137,7 @@ fn command_lazy( call: &EvaluatedCall, lazy: NuLazyFrame, ) -> Result { - let rows: Option = call.opt(0)?; + let rows: Option = call.opt(0)?; let rows = rows.unwrap_or(1); let res: NuLazyFrame = lazy.to_polars().limit(rows).into(); diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/last.rs b/crates/nu_plugin_polars/src/dataframe/command/data/last.rs index 43e4fbc232..694cbfd266 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/last.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/last.rs @@ -111,8 +111,8 @@ fn command_lazy( call: &EvaluatedCall, lazy: NuLazyFrame, ) -> Result { - let rows: Option = call.opt(0)?; - let rows = rows.unwrap_or(DEFAULT_ROWS as u32); + let rows: Option = call.opt(0)?; + let rows = rows.unwrap_or(DEFAULT_ROWS as u64); let res: NuLazyFrame = lazy.to_polars().tail(rows).into(); diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/take.rs b/crates/nu_plugin_polars/src/dataframe/command/data/take.rs index e6c3c3c9b6..368c6337b2 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/take.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/take.rs @@ -106,7 +106,7 @@ fn command( let casted = match index.dtype() { DataType::UInt32 | DataType::UInt64 | DataType::Int32 | DataType::Int64 => index - .cast(&DataType::UInt32) + .cast(&DataType::UInt64) .map_err(|e| ShellError::GenericError { error: "Error casting index list".into(), msg: e.to_string(), @@ -123,7 +123,7 @@ fn command( }), }?; - let indices = casted.u32().map_err(|e| ShellError::GenericError { + let indices = casted.u64().map_err(|e| ShellError::GenericError { error: "Error casting index list".into(), msg: e.to_string(), span: Some(index_span), diff --git a/crates/nu_plugin_polars/src/dataframe/command/index/set_with_idx.rs b/crates/nu_plugin_polars/src/dataframe/command/index/set_with_idx.rs index ff128b0796..06f64b4271 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/index/set_with_idx.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/index/set_with_idx.rs @@ -99,7 +99,7 @@ fn command( let casted = match indices.dtype() { DataType::UInt32 | DataType::UInt64 | DataType::Int32 | DataType::Int64 => indices .as_ref() - .cast(&DataType::UInt32, CastOptions::default()) + .cast(&DataType::UInt64, CastOptions::default()) .map_err(|e| ShellError::GenericError { error: "Error casting indices".into(), msg: e.to_string(), @@ -117,7 +117,7 @@ fn command( }?; let indices = casted - .u32() + .u64() .map_err(|e| ShellError::GenericError { error: "Error casting indices".into(), msg: e.to_string(),