Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(rust): Fix unimplemented panics to give todo!s for AUTO_NEW_STREAMING #18628

Merged
merged 2 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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