Skip to content

Commit 7207433

Browse files
use SessionStateBuilder
The old constructor is deprecated. Ref: apache/datafusion#11403
1 parent 53fcbe8 commit 7207433

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/context.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ use std::path::PathBuf;
2020
use std::str::FromStr;
2121
use std::sync::Arc;
2222

23+
use datafusion::execution::session_state::SessionStateBuilder;
2324
use object_store::ObjectStore;
2425
use url::Url;
2526
use uuid::Uuid;
@@ -50,7 +51,7 @@ use datafusion::datasource::listing::{
5051
use datafusion::datasource::MemTable;
5152
use datafusion::datasource::TableProvider;
5253
use datafusion::execution::context::{
53-
SQLOptions, SessionConfig, SessionContext, SessionState, TaskContext,
54+
SQLOptions, SessionConfig, SessionContext, TaskContext,
5455
};
5556
use datafusion::execution::disk_manager::DiskManagerConfig;
5657
use datafusion::execution::memory_pool::{FairSpillPool, GreedyMemoryPool, UnboundedMemoryPool};
@@ -281,7 +282,11 @@ impl PySessionContext {
281282
RuntimeConfig::default()
282283
};
283284
let runtime = Arc::new(RuntimeEnv::new(runtime_config)?);
284-
let session_state = SessionState::new_with_config_rt(config, runtime);
285+
let session_state = SessionStateBuilder::new()
286+
.with_config(config)
287+
.with_runtime_env(runtime)
288+
.with_default_features()
289+
.build();
285290
Ok(PySessionContext {
286291
ctx: SessionContext::new_with_state(session_state),
287292
})

0 commit comments

Comments
 (0)