polars_plan/dsl/functions/coerce.rs
1use super::*;
2
3/// Take several expressions and collect them into a [`StructChunked`].
4/// # Panics
5/// panics if `exprs` is empty.
6pub fn as_struct(exprs: Vec<Expr>) -> Expr {
7 assert!(
8 !exprs.is_empty(),
9 "expected at least 1 field in 'as_struct'"
10 );
11 Expr::n_ary(FunctionExpr::AsStruct, exprs)
12}