You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datafusion.apache.org by ti...@apache.org on 2025/05/17 19:06:38 UTC

(datafusion-python) branch main updated: With the update to rustc 1.87 we now fail clippy due to the size of the error type. Work around this by boxing the datafusion error. (#1126)

This is an automated email from the ASF dual-hosted git repository.

timsaucer pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion-python.git


The following commit(s) were added to refs/heads/main by this push:
     new 5a62c4b7 With the update to rustc 1.87 we now fail clippy due to the size of the error type. Work around this by boxing the datafusion error. (#1126)
5a62c4b7 is described below

commit 5a62c4b70011dea435d83350b0615804a748e02b
Author: Tim Saucer <ti...@gmail.com>
AuthorDate: Sat May 17 20:06:34 2025 +0100

    With the update to rustc 1.87 we now fail clippy due to the size of the error type. Work around this by boxing the datafusion error. (#1126)
---
 src/errors.rs |  4 ++--
 src/expr.rs   | 14 ++++++--------
 2 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/src/errors.rs b/src/errors.rs
index f1d5aeb2..d4f4f221 100644
--- a/src/errors.rs
+++ b/src/errors.rs
@@ -28,7 +28,7 @@ pub type PyDataFusionResult<T> = std::result::Result<T, PyDataFusionError>;
 
 #[derive(Debug)]
 pub enum PyDataFusionError {
-    ExecutionError(InnerDataFusionError),
+    ExecutionError(Box<InnerDataFusionError>),
     ArrowError(ArrowError),
     Common(String),
     PythonError(PyErr),
@@ -55,7 +55,7 @@ impl From<ArrowError> for PyDataFusionError {
 
 impl From<InnerDataFusionError> for PyDataFusionError {
     fn from(err: InnerDataFusionError) -> PyDataFusionError {
-        PyDataFusionError::ExecutionError(err)
+        PyDataFusionError::ExecutionError(Box::new(err))
     }
 }
 
diff --git a/src/expr.rs b/src/expr.rs
index 404e575f..bc7dbeff 100644
--- a/src/expr.rs
+++ b/src/expr.rs
@@ -37,9 +37,7 @@ use datafusion::logical_expr::{
 };
 
 use crate::common::data_type::{DataTypeMap, NullTreatment, PyScalarValue, RexType};
-use crate::errors::{
-    py_runtime_err, py_type_err, py_unsupported_variant_err, PyDataFusionError, PyDataFusionResult,
-};
+use crate::errors::{py_runtime_err, py_type_err, py_unsupported_variant_err, PyDataFusionResult};
 use crate::expr::aggregate_expr::PyAggregateFunction;
 use crate::expr::binary_expr::PyBinaryExpr;
 use crate::expr::column::PyColumn;
@@ -622,11 +620,11 @@ impl PyExpr {
                 order_by,
                 null_treatment,
             ),
-            _ => Err(
-                PyDataFusionError::ExecutionError(datafusion::error::DataFusionError::Plan(
-                    format!("Using {} with `over` is not allowed. Must use an aggregate or window function.", self.expr.variant_name()),
-                ))
-            ),
+            _ => Err(datafusion::error::DataFusionError::Plan(format!(
+                "Using {} with `over` is not allowed. Must use an aggregate or window function.",
+                self.expr.variant_name()
+            ))
+            .into()),
         }
     }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org