mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-07-31 14:17:45 +00:00
fix(aggregate): propagate errors from aggregate operation closures (#1005)
This commit is contained in:
parent
8db6af6376
commit
c1bbcafb14
1 changed files with 9 additions and 1 deletions
|
@ -96,9 +96,17 @@ export def main [
|
|||
let column_results = $columns
|
||||
| each {|col| # col: cell-path
|
||||
let column = $group.items | get-item-with-error $col {span: $md.span, items: $grouped}
|
||||
$agg_ops | items {|op_name, op| # op_name: string, op: closure
|
||||
let agg_results = $agg_ops | items {|op_name, op| # op_name: string, op: closure
|
||||
$column | do $op | wrap (aggregate-col-name $col $op_name)
|
||||
}
|
||||
|
||||
for r in $agg_results {
|
||||
if ($r | describe) == error {
|
||||
return $r
|
||||
}
|
||||
}
|
||||
|
||||
$agg_results
|
||||
| reduce {|it| merge $it}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue