Skip to content

Apache DataFusion SQL Query Engine

Mark default_session_builder deprecated, add since markings (#6123)

Andrew Lamb5e835b0ea31f
diff --git a/datafusion/core/src/dataframe.rs b/datafusion/core/src/dataframe.rs
index 380f722a42..760ce7c0f5 100644
--- a/datafusion/core/src/dataframe.rs
+++ b/datafusion/core/src/dataframe.rs
@@ -825,7 +825,7 @@ impl DataFrame {
/// Note: This method should not be used outside testing, as it loses the snapshot
/// of the [`SessionState`] attached to this [`DataFrame`] and consequently subsequent
/// operations may take place against a different state
- #[deprecated(note = "Use DataFrame::into_optimized_plan")]
+ #[deprecated(since = "23.0.0", note = "Use DataFrame::into_optimized_plan")]
pub fn to_logical_plan(self) -> Result<LogicalPlan> {
self.into_optimized_plan()
}
diff --git a/datafusion/core/src/execution/context.rs b/datafusion/core/src/execution/context.rs
index 50aea80fc9..d1cbb740fa 100644
--- a/datafusion/core/src/execution/context.rs
+++ b/datafusion/core/src/execution/context.rs
@@ -1108,6 +1108,7 @@ impl SessionContext {
///
/// [`table`]: SessionContext::table
#[deprecated(
+ since = "23.0.0",
note = "Please use the catalog provider interface (`SessionContext::catalog`) to examine available catalogs, schemas, and tables"
)]
pub fn tables(&self) -> Result<HashSet<String>> {
@@ -1124,6 +1125,7 @@ impl SessionContext {
/// Optimizes the logical plan by applying optimizer rules.
#[deprecated(
+ since = "23.0.0",
note = "Use SessionState::optimize to ensure a consistent state for planning and execution"
)]
pub fn optimize(&self, plan: &LogicalPlan) -> Result<LogicalPlan> {
@@ -1132,6 +1134,7 @@ impl SessionContext {
/// Creates a physical plan from a logical plan.
#[deprecated(
+ since = "23.0.0",
note = "Use SessionState::create_physical_plan or DataFrame::create_physical_plan to ensure a consistent state for planning and execution"
)]
pub async fn create_physical_plan(
@@ -1281,6 +1284,10 @@ impl Debug for SessionState {
}
/// Default session builder using the provided configuration
+#[deprecated(
+ since = "23.0.0",
+ note = "See SessionContext::with_config() or SessionState::with_config_rt"
+)]
pub fn default_session_builder(config: SessionConfig) -> SessionState {
SessionState::with_config_rt(config, Arc::new(RuntimeEnv::default()))
}