Skip to content

Commit 8affdc0

Browse files
committed
Fixed CI test for exported classes to check if Expr class covers RawExpr
1 parent 3c15d55 commit 8affdc0

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

python/datafusion/expr.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@
8686
Partitioning = expr_internal.Partitioning
8787
Placeholder = expr_internal.Placeholder
8888
Projection = expr_internal.Projection
89-
RawExpr = expr_internal.RawExpr
9089
Repartition = expr_internal.Repartition
9190
ScalarSubquery = expr_internal.ScalarSubquery
9291
ScalarVariable = expr_internal.ScalarVariable
@@ -199,6 +198,11 @@ def __init__(self, expr: expr_internal.RawExpr) -> None:
199198
"""This constructor should not be called by the end user."""
200199
self.expr = expr
201200

201+
@property
202+
def raw_expr(self) -> expr_internal.RawExpr:
203+
"""Returns the underlying RawExpr instance."""
204+
return self.expr
205+
202206
def to_variant(self) -> Any:
203207
"""Convert this expression into a python object if possible."""
204208
return self.expr.to_variant()

python/tests/test_wrapper_coverage.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,15 @@ def missing_exports(internal_obj, wrapped_obj) -> None:
3434
return
3535

3636
for attr in dir(internal_obj):
37-
if attr in ["_global_ctx"]:
37+
# Skip internal context and RawExpr (which is handled by Expr class)
38+
if attr in ["_global_ctx", "RawExpr"]:
39+
continue
40+
41+
# Check if RawExpr functionality is covered by Expr class
42+
if attr == "RawExpr" and hasattr(wrapped_obj, "Expr"):
43+
expr_class = getattr(wrapped_obj, "Expr")
44+
assert hasattr(expr_class, "raw_expr"), "Expr class must provide raw_expr property"
3845
continue
39-
assert attr in dir(wrapped_obj)
4046

4147
internal_attr = getattr(internal_obj, attr)
4248
wrapped_attr = getattr(wrapped_obj, attr)

0 commit comments

Comments
 (0)