timsaucer commented on code in PR #1059: URL: https://github.com/apache/datafusion-python/pull/1059#discussion_r1987943713
########## src/expr.rs: ########## @@ -100,22 +100,37 @@ pub mod window; use sort_expr::{to_sort_expressions, PySortExpr}; +// Define the new RawExpr struct and implement Debug trait +#[derive(Debug, Clone)] +pub struct RawExpr { + pub expr: Expr, +} + +// Implement conversion from RawExpr to Expr +impl From<RawExpr> for Expr { + fn from(raw_expr: RawExpr) -> Expr { + raw_expr.expr + } +} + /// A PyExpr that can be used on a DataFrame #[pyclass(name = "Expr", module = "datafusion.expr", subclass)] #[derive(Debug, Clone)] pub struct PyExpr { - pub expr: Expr, + pub raw_expr: RawExpr, } Review Comment: I don't think we need another wrapper struct. Rather, I think you need to change the pyo3 class name to `RawExpr`. ``` #[pyclass(name = "RawExpr", module = "datafusion.expr", subclass)] ``` This will probably require updates to the CI script that checks for all classes that require exporting. You should also be able to test the debug error by going into any of the methods in `functions.py` and remove the `.expr` to get the inner object and see the error generated is updated. -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org