From 9896f84f18a197c6e3be08fe89fcebc79645b5e7 Mon Sep 17 00:00:00 2001 From: librasteve Date: Wed, 4 Oct 2023 18:05:41 +0000 Subject: [PATCH] wip debug --- apply/src/apply.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/apply/src/apply.rs b/apply/src/apply.rs index b35610e..3ff9f87 100644 --- a/apply/src/apply.rs +++ b/apply/src/apply.rs @@ -2,7 +2,7 @@ extern crate polars; use polars::prelude::*;//{CsvReader, DataType, DataFrame, Series}; use polars::lazy::dsl; -use polars::lazy::dsl::Expr; +//use polars::lazy::dsl::Expr; fn check_ptr<'a, T>(ptr: *mut T) -> &'a mut T { unsafe { @@ -21,6 +21,7 @@ impl ExprC { } } +/* //START_APPLY - monadic fn do_apply_monadic(vals: Series) -> Result, PolarsError> { let x = vals @@ -42,6 +43,7 @@ pub extern "C" fn ap_apply_monadic(ptr: *mut ExprC) -> *mut ExprC { let ex_n = ExprC::new(new_inn.clone()); Box::into_raw(Box::new(ex_n)) } +*/ /* Monadic Exemplar .i32() @@ -54,9 +56,18 @@ pub extern "C" fn ap_apply_monadic(ptr: *mut ExprC) -> *mut ExprC { //START_APPLY - dyadic fn do_apply_dyadic(s: Series) -> Result, PolarsError> { + // my debug code let df = DataFrame::new(vec![s.clone()]); println!("{:?}", &df); + let df2 = df?.clone().lazy().with_column(col("values")).collect()?; + println!("{:?}", &df2); + + let df3 = df2.clone().lazy().select([col("values").value_counts(true, true)]).unnest(["values"]).collect()?; + println!("{:?}", &df3); + + println!("debug over -----------------"); + // downcast to struct let ca = s.struct_()?;