-
Couldn't load subscription status.
- Fork 1.7k
Rename SessionContext::with_config_rt to SessionContext::new_with_config_from_rt, etc
#7631
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
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 <[email protected]>
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 <[email protected]> --------- Co-authored-by: Liang-Chi Hsieh <[email protected]>
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_rtcreates a newSessionContextwhile most methods in DataFusion that start withwithare 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?
newprefix toSessionContext::with_config_rtand related functions so they are calledSessionContext::new_with_config_from_rtdefault_session_builderwhich was deprecated almost 10 releases agoAre these changes tested?
Existing tests
Are there any user-facing changes?