Skip to content

Commit

Permalink
fix[rust]: break infinite loop in type coercion optimizer (#4653)
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed Sep 1, 2022
1 parent 4cd98b3 commit 4dcf204
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
1 change: 0 additions & 1 deletion polars/polars-lazy/src/dsl/function_expr/is_in.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use super::*;
pub(super) fn is_in(s: &mut [Series]) -> Result<Series> {
let left = &s[0];
let other = &s[1];
dbg!(left, other);

left.is_in(other).map(|ca| ca.into_series())
}
14 changes: 9 additions & 5 deletions polars/polars-lazy/src/logical_plan/optimizer/type_coercion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,11 +423,15 @@ impl OptimizationRule for TypeCoercionRule {
let super_type = get_supertype(&type_left, &type_fill_value).ok()?;
let super_type =
modify_supertype(super_type, left, fill_value, &type_left, &type_fill_value);
Some(AExpr::Function {
function: FunctionExpr::FillNull { super_type },
input: input.clone(),
options,
})
if super_type != DataType::Unknown {
Some(AExpr::Function {
function: FunctionExpr::FillNull { super_type },
input: input.clone(),
options,
})
} else {
None
}
}
// generic type coercion of any function.
AExpr::Function {
Expand Down

0 comments on commit 4dcf204

Please sign in to comment.