Spaarsh commented on code in PR #1059:
URL:
https://github.com/apache/datafusion-python/pull/1059#discussion_r1990066690
##########
python/tests/test_wrapper_coverage.py:
##########
@@ -34,9 +34,15 @@ def missing_exports(internal_obj, wrapped_obj) -> None:
return
for attr in dir(internal_obj):
- if attr in ["_global_ctx"]:
+ # Skip internal context and RawExpr (which is handled by Expr class)
+ if attr in ["_global_ctx", "RawExpr"]:
+ continue
+
+ # Check if RawExpr functionality is covered by Expr class
+ if attr == "RawExpr" and hasattr(wrapped_obj, "Expr"):
+ expr_class = getattr(wrapped_obj, "Expr")
+ assert hasattr(expr_class, "raw_expr"), "Expr class must provide
raw_expr property"
Review Comment:
Yes I am sorry. I thought that I could include that after renaming other
classes. I am now simply extracting the `base_class` name from the ```Raw```
attr name via string slicing and then use it to check if the `base_class` has
such an attribute:
```
if attr in ["_global_ctx"]:
continue
# Check if RawExpr functionality is covered by Expr class
if attr.startswith("Raw"):
base_class = attr[3:] # Remove "Raw" prefix
assert hasattr(wrapped_obj, base_class), f"Missing implementation for
{attr}"
continue
```
Sorry for being this clumsy. Thanks a lot for your patience.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]