diff --git a/fennel/CHANGELOG.md b/fennel/CHANGELOG.md index 143f2013..b7e3f7e3 100644 --- a/fennel/CHANGELOG.md +++ b/fennel/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## [1.5.25] - 2024-09-24 +- Fix unary operator expressions + ## [1.5.24] - 2024-09-18 - Add support for aggregation on optional dtype columns diff --git a/fennel/expr/test_expr.py b/fennel/expr/test_expr.py index 478bd0ae..be2d3555 100644 --- a/fennel/expr/test_expr.py +++ b/fennel/expr/test_expr.py @@ -769,12 +769,12 @@ def test_list(): ), # List contains ExprTestCase( - expr=(col("a").list.contains(3)), + expr=(~col("a").list.contains(3)), df=pd.DataFrame({"a": [[1, 2, 3], [4, 5, 6], [7, 8, 9]]}), schema={"a": List[int]}, - display="CONTAINS(col('a'), 3)", + display="~(CONTAINS(col('a'), 3))", refs={"a"}, - eval_result=[True, False, False], + eval_result=[False, True, True], expected_dtype=bool, proto_json=None, ), diff --git a/fennel/expr/visitor.py b/fennel/expr/visitor.py index 6e7cf4c1..8affab86 100644 --- a/fennel/expr/visitor.py +++ b/fennel/expr/visitor.py @@ -179,7 +179,7 @@ def visitRef(self, obj): return str(obj) def visitUnary(self, obj): - return "%s(%s)" % (obj.op, self.visit(obj.expr)) + return "%s(%s)" % (obj.op, self.visit(obj.operand)) def visitBinary(self, obj): return "(%s %s %s)" % ( diff --git a/pyproject.toml b/pyproject.toml index 9377b989..74264934 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "fennel-ai" -version = "1.5.24" +version = "1.5.25" description = "The modern realtime feature engineering platform" authors = ["Fennel AI "] packages = [{ include = "fennel" }]