Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions prqlc/prqlc/src/semantic/resolver/transforms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,12 +328,12 @@ impl Resolver<'_> {
let list_items = list_items
.into_iter()
.map(|item| {
Expr::new(ExprKind::FuncCall(FuncCall::new_simple(
self.fold_expr(Expr::new(ExprKind::FuncCall(FuncCall::new_simple(
func.clone(),
vec![item],
)))
))))
})
.collect_vec();
.collect::<Result<Vec<_>>>()?;

return Ok(Expr {
kind: ExprKind::Tuple(list_items),
Expand Down
19 changes: 19 additions & 0 deletions prqlc/prqlc/tests/integration/sql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7275,3 +7275,22 @@ fn test_partial_application_of_transform() {
10
");
}

#[test]
fn test_tuple_map() {
assert_snapshot!(compile(r###"
let add_four = func a -> a + 4

from foo
select {x, y}
derive (tuple_map add_four foo.*)
"###).unwrap(), @"
SELECT
x,
y,
x + 4,
y + 4
FROM
foo
");
}
Loading