mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 12:25:58 +02:00
* Fix "index out of bounds" when input to group-by is empty #4369 * Fix formatting #4369 * Adds test for empty input Co-authored-by: Ray Henry <ray.henry@thermofisher.com>
This commit is contained in:
@ -95,8 +95,6 @@ pub fn group_by(
|
||||
let mut keys: Vec<Result<String, ShellError>> = vec![];
|
||||
let mut group_strategy = Grouper::ByColumn(None);
|
||||
|
||||
let first = values[0].clone();
|
||||
|
||||
if values.is_empty() {
|
||||
return Err(ShellError::SpannedLabeledError(
|
||||
"expected table from pipeline".into(),
|
||||
@ -105,6 +103,8 @@ pub fn group_by(
|
||||
));
|
||||
}
|
||||
|
||||
let first = values[0].clone();
|
||||
|
||||
let value_list = Value::List {
|
||||
vals: values.clone(),
|
||||
span: name,
|
||||
|
Reference in New Issue
Block a user