This is an automated email from the ASF dual-hosted git repository.

alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git


The following commit(s) were added to refs/heads/main by this push:
     new c0d53adf83 add method SessionStateBuilder::new_with_default_features() 
(#14998)
c0d53adf83 is described below

commit c0d53adf8323b840d0adaa62ba868d6acd4ba886
Author: Shruti Sharma <[email protected]>
AuthorDate: Wed Mar 5 16:17:48 2025 +0530

    add method SessionStateBuilder::new_with_default_features() (#14998)
    
    * add func SessionStateBuilder::new_with_defaults()
    
    * update name
    
    * add comment
---
 datafusion/core/src/execution/session_state.rs | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/datafusion/core/src/execution/session_state.rs 
b/datafusion/core/src/execution/session_state.rs
index 2ec1ba07b9..d26d5a219e 100644
--- a/datafusion/core/src/execution/session_state.rs
+++ b/datafusion/core/src/execution/session_state.rs
@@ -1023,6 +1023,9 @@ impl SessionStateBuilder {
     ///
     /// See [`Self::with_default_features`] to install the default set of 
functions,
     /// catalogs, etc.
+    ///
+    /// To create a `SessionStateBuilder` with default features such as 
functions,
+    /// please see [`Self::new_with_default_features`].
     pub fn new() -> Self {
         Self {
             session_id: None,
@@ -1144,6 +1147,22 @@ impl SessionStateBuilder {
         self
     }
 
+    /// Returns a new [`SessionStateBuilder`] with default features.
+    ///
+    /// This is equivalent to calling [`Self::new()`] followed by 
[`Self::with_default_features()`].
+    ///
+    /// ```
+    /// use datafusion::execution::session_state::SessionStateBuilder;
+    ///
+    /// // Create a new SessionState with default features
+    /// let session_state = SessionStateBuilder::new_with_default_features()
+    ///     .with_session_id("my_session".to_string())
+    ///     .build();
+    /// ```
+    pub fn new_with_default_features() -> Self {
+        Self::new().with_default_features()
+    }
+
     /// Set the session id.
     pub fn with_session_id(mut self, session_id: String) -> Self {
         self.session_id = Some(session_id);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to