Skip to content

Commit bbd44d4

Browse files
committed
Substrait functions now take SessionState instead of SessionContext
1 parent b2f326a commit bbd44d4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/substrait.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ impl PySubstraitProducer {
114114
/// Convert DataFusion LogicalPlan to Substrait Plan
115115
#[staticmethod]
116116
pub fn to_substrait_plan(plan: PyLogicalPlan, ctx: &PySessionContext) -> PyResult<PyPlan> {
117-
match producer::to_substrait_plan(&plan.plan, &ctx.ctx) {
117+
let session_state = ctx.ctx.state();
118+
match producer::to_substrait_plan(&plan.plan, &session_state) {
118119
Ok(plan) => Ok(PyPlan { plan: *plan }),
119120
Err(e) => Err(py_datafusion_err(e)),
120121
}
@@ -134,7 +135,8 @@ impl PySubstraitConsumer {
134135
plan: PyPlan,
135136
py: Python,
136137
) -> PyResult<PyLogicalPlan> {
137-
let result = consumer::from_substrait_plan(&ctx.ctx, &plan.plan);
138+
let session_state = ctx.ctx.state();
139+
let result = consumer::from_substrait_plan(&session_state, &plan.plan);
138140
let logical_plan = wait_for_future(py, result).map_err(DataFusionError::from)?;
139141
Ok(PyLogicalPlan::new(logical_plan))
140142
}

0 commit comments

Comments
 (0)