-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Rename SessionContext::with_config_rt
to SessionContext::new_with_config_from_rt
, etc
#7631
Conversation
…config_from_rt`, etc
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.
LGTM 👍
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.
LGTM
Probably we can also consider create_
instead of new_
to be more like Factory method pattern
https://en.wikipedia.org/wiki/Factory_method_pattern#UML_class_diagram
Thanks for supporting old and new method names to provide backward compatibility with downstream
Co-authored-by: Liang-Chi Hsieh <viirya@gmail.com>
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.
…config_from_rt`, etc (apache#7631) * Rename `SessionContext::with_config_rt` to `SessionContext::new_with_config_from_rt`, etc * update other references * Apply suggestions from code review Co-authored-by: Liang-Chi Hsieh <viirya@gmail.com> --------- Co-authored-by: Liang-Chi Hsieh <viirya@gmail.com>
Which issue does this PR close?
N/A
Rationale for this change
The names for creating SessionContext and SessionState are inconsistent, which has bothered me for a long time.
It is confusing that
SessionContext::with_config_rt
creates a newSessionContext
while most methods in DataFusion that start withwith
are used to update a field.This is a small papercut but I think it makes DataFusion that much harder to use / embed as it doesn't follow existing Rust Idioms
What changes are included in this PR?
new
prefix toSessionContext::with_config_rt
and related functions so they are calledSessionContext::new_with_config_from_rt
default_session_builder
which was deprecated almost 10 releases agoAre these changes tested?
Existing tests
Are there any user-facing changes?