Skip to content

Commit 1ee861a

Browse files
committed
fix: handle potential errors when caching DataFrame and retrieving execution plan
1 parent cfc3c40 commit 1ee861a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/dataframe.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ impl PyDataFrame {
403403
/// Cache DataFrame.
404404
fn cache(&self, py: Python) -> PyDataFusionResult<Self> {
405405
let df = wait_for_future(py, self.df.as_ref().clone().cache())?;
406-
Ok(Self::new(df))
406+
Ok(Self::new(df?))
407407
}
408408

409409
/// Executes this DataFrame and collects all results into a vector of vector of RecordBatch
@@ -514,7 +514,7 @@ impl PyDataFrame {
514514
/// Get the execution plan for this `DataFrame`
515515
fn execution_plan(&self, py: Python) -> PyDataFusionResult<PyExecutionPlan> {
516516
let plan = wait_for_future(py, self.df.as_ref().clone().create_physical_plan())?;
517-
Ok(PyExecutionPlan::new(plan))
517+
Ok(PyExecutionPlan::new(plan?))
518518
}
519519

520520
/// Repartition a `DataFrame` based on a logical partitioning scheme.

0 commit comments

Comments
 (0)