Skip to content

Commit 625f8fa

Browse files
committed
error conversion
1 parent d605d59 commit 625f8fa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/dataframe.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ impl PyDataFrame {
663663

664664
fn distributed_plan(&self, num_shards: usize, py: Python<'_>) -> PyResult<DistributedPlan> {
665665
let distributed_plan = wait_for_future(py, split_physical_plan(&self.df, num_shards))
666-
.map_err(PyErr::from)?;
666+
.map_err(py_datafusion_err)?;
667667
Ok(distributed_plan)
668668
}
669669

@@ -802,11 +802,11 @@ pub fn shard_stream(serialized_shard_plan: &[u8]) -> PyResult<PyRecordBatchStrea
802802
let codec = DeltaPhysicalCodec {};
803803
let node = PhysicalPlanNode::decode(serialized_shard_plan)
804804
.map_err(|e| datafusion::error::DataFusionError::External(Box::new(e)))
805-
.map_err(PyErr::from)?;
805+
.map_err(py_datafusion_err)?;
806806
let plan = node.try_into_physical_plan(&registry, &runtime, &codec)?;
807807
println!("Shard plan: {}", displayable(plan.as_ref()).one_line());
808808
let ctx = TaskContext::default();
809-
execute_stream(plan, Arc::new(ctx)).map(PyRecordBatchStream::new).map_err(PyErr::from)
809+
execute_stream(plan, Arc::new(ctx)).map(PyRecordBatchStream::new).map_err(py_datafusion_err)
810810
}
811811

812812
/// Print DataFrame

0 commit comments

Comments
 (0)