Skip to content

Commit

Permalink
refactor: remove old DSL describe code
Browse files Browse the repository at this point in the history
  • Loading branch information
coastalwhite committed May 15, 2024
1 parent 032ffe9 commit 6f4c109
Show file tree
Hide file tree
Showing 17 changed files with 117 additions and 1,367 deletions.
3 changes: 1 addition & 2 deletions crates/polars-lazy/src/frame/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -520,8 +520,7 @@ impl LazyFrame {
}

pub fn to_alp(self) -> PolarsResult<IRPlan> {
let (node, lp_arena, expr_arena) = self.logical_plan.to_alp()?;
Ok(IRPlan::new(node, lp_arena, expr_arena))
self.logical_plan.to_alp()
}

pub(crate) fn optimize_with_scratch(
Expand Down
2 changes: 1 addition & 1 deletion crates/polars-lazy/src/physical_plan/expressions/apply.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl ApplyExpr {
) -> Self {
#[cfg(debug_assertions)]
if matches!(options.collect_groups, ApplyOptions::ElementWise) && options.returns_scalar {
panic!("expr {} is not implemented correctly. 'returns_scalar' and 'elementwise' are mutually exclusive", expr)
panic!("expr {:?} is not implemented correctly. 'returns_scalar' and 'elementwise' are mutually exclusive", expr)
}

Self {
Expand Down
4 changes: 2 additions & 2 deletions crates/polars-lazy/src/physical_plan/expressions/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ impl<'a> AggregationContext<'a> {
(true, &DataType::List(_)) => {
if series.len() != self.groups.len() {
let fmt_expr = if let Some(e) = expr {
format!("'{e}' ")
format!("'{e:?}' ")
} else {
String::new()
};
Expand Down Expand Up @@ -589,7 +589,7 @@ impl Display for &dyn PhysicalExpr {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
match self.as_expression() {
None => Ok(()),
Some(e) => write!(f, "{e}"),
Some(e) => write!(f, "{e:?}"),
}
}
}
Expand Down
11 changes: 9 additions & 2 deletions crates/polars-lazy/src/physical_plan/streaming/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,15 @@ pub(super) fn dbg_tree(tree: Tree, lp_arena: &Arena<IR>, expr_arena: &Arena<AExp
.unwrap();

println!("SUBPLAN ELIGIBLE FOR STREAMING:");
let lp = node_to_lp(root, expr_arena, &mut (lp_arena.clone()));
println!("{lp:?}\n");
println!(
"{}\n",
IRPlanRef {
lp_top: root,
lp_arena,
expr_arena
}
.display()
);

println!("PIPELINE TREE:");
for (i, branch) in tree.iter().enumerate() {
Expand Down
Loading

0 comments on commit 6f4c109

Please sign in to comment.