Spaarsh commented on code in PR #1059:
URL: 
https://github.com/apache/datafusion-python/pull/1059#discussion_r1988468214


##########
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:
   Yep I am getting this error:
   ```
   Traceback (most recent call last):
     File "/home/user/datafusion-python/rename.py", line 3, in <module>
       result = f.isnan(col("a"))
     File "/home/user/datafusion-python/python/datafusion/functions.py", line 
284, in isnan
       return Expr(f.isnan(expr))
   TypeError: argument 'num': 'Expr' object cannot be converted to 'RawExpr'
   ```
   When I try to run:
   ```
   from datafusion import col, functions as f
   
   result = f.isnan(col("a"))
   print(result)
   ```



-- 
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

Reply via email to