diff --git a/src/util.rs b/src/util.rs index 5aaf43d..43dfa37 100644 --- a/src/util.rs +++ b/src/util.rs @@ -46,7 +46,7 @@ impl Ark { let mut ark = Self { df: match existing_file { true => Self::read_parquet(&ticker, path.as_ref())?, - false => DF::DataFrame(df!["date" => [""],]?), + false => DF::DataFrame(Box::new(df!["date" => [""],]?)), }, ticker, path, diff --git a/src/util/df.rs b/src/util/df.rs index bed277a..265f440 100644 --- a/src/util/df.rs +++ b/src/util/df.rs @@ -4,19 +4,19 @@ use polars::prelude::{IntoLazy, LazyFrame}; #[derive(Clone)] pub enum DF { - LazyFrame(LazyFrame), - DataFrame(DataFrame), + LazyFrame(Box), + DataFrame(Box), } impl From for DF { fn from(lf: LazyFrame) -> Self { - Self::LazyFrame(lf) + Self::LazyFrame(Box::new(lf)) } } impl From for DF { fn from(df: DataFrame) -> Self { - Self::DataFrame(df) + Self::DataFrame(Box::new(df)) } } @@ -24,12 +24,12 @@ impl DF { pub fn collect(self) -> anyhow::Result { match self { Self::LazyFrame(x) => Ok(x.collect()?), - Self::DataFrame(x) => Ok(x), + Self::DataFrame(x) => Ok(*x), } } pub fn lazy(self) -> LazyFrame { match self { - Self::LazyFrame(x) => x, + Self::LazyFrame(x) => *x, Self::DataFrame(x) => x.lazy(), } }