Rename SessionContext::with_config_rt to SessionContext::new_with_config_from_rt, etc#7631
Merged
alamb merged 5 commits intoapache:mainfrom Oct 4, 2023
Merged
Conversation
…config_from_rt`, etc
comphead
approved these changes
Oct 3, 2023
Contributor
comphead
left a comment
There was a problem hiding this comment.
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
viirya
reviewed
Oct 3, 2023
viirya
reviewed
Oct 3, 2023
viirya
reviewed
Oct 3, 2023
viirya
reviewed
Oct 3, 2023
viirya
approved these changes
Oct 3, 2023
Co-authored-by: Liang-Chi Hsieh <viirya@gmail.com>
Ted-Jiang
pushed a commit
to Ted-Jiang/arrow-datafusion
that referenced
this pull request
Oct 7, 2023
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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?