Skip to content
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
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ __pycache__/
*.py[cod]
*$py.class

# Python dist ignore
dist

# C extensions
*.so

Expand All @@ -24,4 +27,4 @@ apache-rat-*.jar
.env
CHANGELOG.md.bak

docs/mdbook/book
docs/mdbook/book
19 changes: 13 additions & 6 deletions src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,14 +380,21 @@ impl PyExpr {
let mut operands: Vec<PyExpr> = 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()));
};
Expand Down