Open ZemanOndrej opened 1 week ago
Can you provide a reproducible test case? Thanks. (Not exactly sure how/where you're calling your SQL expression 🤔)
use polars::{
frame::DataFrame,
prelude::{IntoLazy, NamedFrom},
series::Series,
sql::SQLContext,
};
fn main() {
let series_data = Series::new("column1", ["a", "b", "c"]);
let df = DataFrame::new(vec![series_data]).unwrap();
let mut sql_context = SQLContext::new();
sql_context.register("table1", df.lazy());
let df = sql_context
.execute("SELECT * FROM table1 WHERE 'a' IN ('b', 'a')")
.unwrap();
println!("{:?}", df.collect());
}
thread 'main' panicked at /home/ubuntu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/polars-expr-0.42.0/src/expressions/apply.rs:45:13: expr String(a).is_in([Series]) is not implemented correctly. 'returns_scalar' and 'elementwise' are mutually exclusive stack backtrace:
I know this kind of select statement is wrong but I would expect it to work. In release mode it works.
I am trying to execute sql expression like 'value' IN ('value2', 'value') and this debug_assertions panics https://github.com/pola-rs/polars/blob/5ccb238d62e2e3e471718462714a1c61d97c72c3/crates/polars-expr/src/expressions/apply.rs#L41-L46 In release mode the expression is executed successfully. why is this assertion needed?