Skip to content

Commit

Permalink
refactor(rust): Fix unimplemented panics to give todo!s for AUTO_NEW_…
Browse files Browse the repository at this point in the history
…STREAMING (#18628)
  • Loading branch information
orlp authored Sep 9, 2024
1 parent 433d6c0 commit 4d176e0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
4 changes: 3 additions & 1 deletion crates/polars-lazy/src/frame/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,9 @@ impl LazyFrame {
// Fallback to normal engine if error is due to not being implemented
// and auto_new_streaming is set, otherwise propagate error.
if auto_new_streaming
&& e.downcast_ref::<&str>() == Some(&"not yet implemented")
&& e.downcast_ref::<&str>()
.map(|s| s.starts_with("not yet implemented"))
.unwrap_or(false)
{
if polars_core::config::verbose() {
eprintln!("caught unimplemented error in new streaming engine, falling back to normal engine");
Expand Down
13 changes: 10 additions & 3 deletions crates/polars-stream/src/physical_plan/lower_ir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::sync::Arc;

use polars_core::prelude::{InitHashMaps, PlHashMap, PlIndexMap};
use polars_core::schema::Schema;
use polars_error::{polars_err, PolarsResult};
use polars_error::PolarsResult;
use polars_plan::plans::expr_ir::{ExprIR, OutputName};
use polars_plan::plans::{AExpr, IR};
use polars_plan::prelude::SinkType;
Expand Down Expand Up @@ -345,7 +345,7 @@ pub fn lower_ir(

let paths = sources
.into_paths()
.ok_or_else(|| polars_err!(nyi = "Streaming scanning of in-memory buffers"))?;
.unwrap_or_else(|| todo!("streaming scanning of in-memory buffers"));

PhysNodeKind::FileScan {
paths,
Expand All @@ -358,7 +358,14 @@ pub fn lower_ir(
}
},

_ => todo!(),
IR::PythonScan { .. } => todo!(),
IR::Reduce { .. } => todo!(),
IR::Cache { .. } => todo!(),
IR::GroupBy { .. } => todo!(),
IR::Join { .. } => todo!(),
IR::Distinct { .. } => todo!(),
IR::ExtContext { .. } => todo!(),
IR::Invalid => unreachable!(),
};

Ok(phys_sm.insert(PhysNode::new(output_schema, node_kind)))
Expand Down

0 comments on commit 4d176e0

Please sign in to comment.