Skip to content

Commit 5a62c4b

Browse files
authored
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)
1 parent f3c98ec commit 5a62c4b

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

src/errors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub type PyDataFusionResult<T> = std::result::Result<T, PyDataFusionError>;
2828

2929
#[derive(Debug)]
3030
pub enum PyDataFusionError {
31-
ExecutionError(InnerDataFusionError),
31+
ExecutionError(Box<InnerDataFusionError>),
3232
ArrowError(ArrowError),
3333
Common(String),
3434
PythonError(PyErr),
@@ -55,7 +55,7 @@ impl From<ArrowError> for PyDataFusionError {
5555

5656
impl From<InnerDataFusionError> for PyDataFusionError {
5757
fn from(err: InnerDataFusionError) -> PyDataFusionError {
58-
PyDataFusionError::ExecutionError(err)
58+
PyDataFusionError::ExecutionError(Box::new(err))
5959
}
6060
}
6161

src/expr.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ use datafusion::logical_expr::{
3737
};
3838

3939
use crate::common::data_type::{DataTypeMap, NullTreatment, PyScalarValue, RexType};
40-
use crate::errors::{
41-
py_runtime_err, py_type_err, py_unsupported_variant_err, PyDataFusionError, PyDataFusionResult,
42-
};
40+
use crate::errors::{py_runtime_err, py_type_err, py_unsupported_variant_err, PyDataFusionResult};
4341
use crate::expr::aggregate_expr::PyAggregateFunction;
4442
use crate::expr::binary_expr::PyBinaryExpr;
4543
use crate::expr::column::PyColumn;
@@ -622,11 +620,11 @@ impl PyExpr {
622620
order_by,
623621
null_treatment,
624622
),
625-
_ => Err(
626-
PyDataFusionError::ExecutionError(datafusion::error::DataFusionError::Plan(
627-
format!("Using {} with `over` is not allowed. Must use an aggregate or window function.", self.expr.variant_name()),
628-
))
629-
),
623+
_ => Err(datafusion::error::DataFusionError::Plan(format!(
624+
"Using {} with `over` is not allowed. Must use an aggregate or window function.",
625+
self.expr.variant_name()
626+
))
627+
.into()),
630628
}
631629
}
632630
}

0 commit comments

Comments
 (0)