diff --git a/.gitignore b/.gitignore index 1d0a84a43..365b89d5c 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,9 @@ __pycache__/ *.py[cod] *$py.class +# Python dist ignore +dist + # C extensions *.so @@ -24,4 +27,4 @@ apache-rat-*.jar .env CHANGELOG.md.bak -docs/mdbook/book \ No newline at end of file +docs/mdbook/book diff --git a/src/expr.rs b/src/expr.rs index c002b3291..f800fab08 100644 --- a/src/expr.rs +++ b/src/expr.rs @@ -380,14 +380,21 @@ impl PyExpr { let mut operands: Vec = Vec::new(); if let Some(e) = expr { - operands.push(PyExpr::from(*e.clone())); + for (when, then) in when_then_expr { + operands.push(PyExpr::from(Expr::BinaryExpr(BinaryExpr::new( + Box::new(*e.clone()), + Operator::Eq, + Box::new(*when.clone()), + )))); + operands.push(PyExpr::from(*then.clone())); + } + } else { + for (when, then) in when_then_expr { + operands.push(PyExpr::from(*when.clone())); + operands.push(PyExpr::from(*then.clone())); + } }; - for (when, then) in when_then_expr { - operands.push(PyExpr::from(*when.clone())); - operands.push(PyExpr::from(*then.clone())); - } - if let Some(e) = else_expr { operands.push(PyExpr::from(*e.clone())); };