Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pola-rs
GitHub Repository: pola-rs/polars
Path: blob/main/crates/polars-plan/src/dsl/functions/coerce.rs
6940 views
1
use super::*;
2
3
/// Take several expressions and collect them into a [`StructChunked`].
4
/// # Panics
5
/// panics if `exprs` is empty.
6
pub 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
}
13
14