Skip to content

Commit 95c6f4c

Browse files
committed
fix(aggregate): propagate errors from aggregate operation closures
1 parent 8db6af6 commit 95c6f4c

File tree

1 file changed

+9
-1
lines changed
  • stdlib-candidate/std-rfc/aggregate

1 file changed

+9
-1
lines changed

stdlib-candidate/std-rfc/aggregate/mod.nu

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,17 @@ export def main [
9696
let column_results = $columns
9797
| each {|col| # col: cell-path
9898
let column = $group.items | get-item-with-error $col {span: $md.span, items: $grouped}
99-
$agg_ops | items {|op_name, op| # op_name: string, op: closure
99+
let agg_results = $agg_ops | items {|op_name, op| # op_name: string, op: closure
100100
$column | do $op | wrap (aggregate-col-name $col $op_name)
101101
}
102+
103+
for r in $agg_results {
104+
if ($r | describe) == error {
105+
return $r
106+
}
107+
}
108+
109+
$agg_results
102110
| reduce {|it| merge $it}
103111
}
104112

0 commit comments

Comments
 (0)