-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add method SessionStateBuilder::new_with_default_features() #14998
base: main
Are you sure you want to change the base?
Conversation
Why don't we just implement Default trait? |
There is some more backstory here: Basically the question is what "defaults" means -- is default an empty builder or does it have all the default functions, etc. An alternate design might be to always create SessionStateBuilder with all default functions and have a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @shruti2522 -- this looks great. I think we just need to improve the name and it will be good to go (assuming it is ok with @berkaysynnada and other reviewers)
Could you also add a comment to SessionStateBuilder::new()
here:
datafusion/datafusion/core/src/execution/session_state.rs
Lines 1022 to 1025 in b377725
/// Returns a new empty [`SessionStateBuilder`]. | |
/// | |
/// See [`Self::with_default_features`] to install the default set of functions, | |
/// catalogs, etc. |
Something like "to create a SessionStateBuilder with default features such as functions please see [SessionStateBuilder::new_with_default_features
}
/// .with_session_id("my_session".to_string()) | ||
/// .build(); | ||
/// ``` | ||
pub fn new_with_defaults() -> Self { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To keep the name consistent (and make it harder to confuse this with default()
) could we please name this default_features
? Like:
pub fn new_with_defaults() -> Self { | |
pub fn new_with_default_features() -> Self { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done @alamb
Which issue does this PR close?
Rationale for this change
What changes are included in this PR?
added method
new_with_defaults
toStreamStateBuilder
Are these changes tested?
Are there any user-facing changes?