From 7207433b21ced93dcff914337c1a96750775cbd3 Mon Sep 17 00:00:00 2001 From: Michael-J-Ward Date: Sat, 10 Aug 2024 14:45:21 -0500 Subject: [PATCH] use SessionStateBuilder The old constructor is deprecated. Ref: https://github.com/apache/datafusion/pull/11403 --- src/context.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/context.rs b/src/context.rs index 50c4a1994..542297f86 100644 --- a/src/context.rs +++ b/src/context.rs @@ -20,6 +20,7 @@ use std::path::PathBuf; use std::str::FromStr; use std::sync::Arc; +use datafusion::execution::session_state::SessionStateBuilder; use object_store::ObjectStore; use url::Url; use uuid::Uuid; @@ -50,7 +51,7 @@ use datafusion::datasource::listing::{ use datafusion::datasource::MemTable; use datafusion::datasource::TableProvider; use datafusion::execution::context::{ - SQLOptions, SessionConfig, SessionContext, SessionState, TaskContext, + SQLOptions, SessionConfig, SessionContext, TaskContext, }; use datafusion::execution::disk_manager::DiskManagerConfig; use datafusion::execution::memory_pool::{FairSpillPool, GreedyMemoryPool, UnboundedMemoryPool}; @@ -281,7 +282,11 @@ impl PySessionContext { RuntimeConfig::default() }; let runtime = Arc::new(RuntimeEnv::new(runtime_config)?); - let session_state = SessionState::new_with_config_rt(config, runtime); + let session_state = SessionStateBuilder::new() + .with_config(config) + .with_runtime_env(runtime) + .with_default_features() + .build(); Ok(PySessionContext { ctx: SessionContext::new_with_state(session_state), })