Sha256: ceda142ba9f737e535a2a689c1e1ef1927223583d6b0b200d68f360352f89627

Contents?: true

Size: 610 Bytes

Versions: 1

Compression:

Stored size: 610 Bytes

Contents

mod array;
mod binary;
mod categorical;
mod datetime;
mod general;
mod list;
mod meta;
mod string;
mod r#struct;

use magnus::RArray;
use polars::lazy::dsl::Expr;

use crate::RbResult;

#[magnus::wrap(class = "Polars::RbExpr")]
#[derive(Clone)]
pub struct RbExpr {
    pub inner: Expr,
}

impl From<Expr> for RbExpr {
    fn from(inner: Expr) -> Self {
        RbExpr { inner }
    }
}

pub fn rb_exprs_to_exprs(rb_exprs: RArray) -> RbResult<Vec<Expr>> {
    let mut exprs = Vec::new();
    for item in rb_exprs.each() {
        exprs.push(item?.try_convert::<&RbExpr>()?.inner.clone());
    }
    Ok(exprs)
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
polars-df-0.6.0 ext/polars/src/expr.rs