-
Notifications
You must be signed in to change notification settings - Fork 820
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
Cleanup parquet type builders #4706
Cleanup parquet type builders #4706
Conversation
pub fn with_fields(mut self, fields: &mut Vec<TypePtr>) -> Self { | ||
self.fields.append(fields); | ||
self | ||
pub fn with_fields(self, fields: Vec<TypePtr>) -> 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.
Accepting &mut Vec<TypePtr>
made for a very unusual interface, changing to accept Vec<TypePtr>
is much "normal"
pub fn with_id(mut self, id: i32) -> Self { | ||
self.id = Some(id); | ||
self | ||
pub fn with_id(self, id: Option<i32>) -> 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.
This makes with_id consistent with the other APIs such as with_logical_type
and with_converted_type
(where ConvertedType has implicit nullability as a result of
ConvertedType::NONE`). It also reflects the fact this setting is most often optional
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.
👌 I think this is a nice improvement
Which issue does this PR close?
Closes #.
Rationale for this change
Noticed whilst investigating #4702
What changes are included in this PR?
Are there any user-facing changes?
The apis for some of setters of
PrimitiveTypeBuilder
have changed