Skip to content
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

StructBuilder Validate Child Data (#4397) #4400

Merged
merged 1 commit into from
Jun 12, 2023

Conversation

tustvold
Copy link
Contributor

Which issue does this PR close?

Closes #4397

Rationale for this change

What changes are included in this PR?

Are there any user-facing changes?

@github-actions github-actions bot added the arrow Changes to the arrow crate label Jun 12, 2023

let array_data = unsafe { builder.build_unchecked() };
StructArray::from(array_data)
StructArray::new(self.fields.clone(), arrays, nulls)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As ArrayBuilder doesn't expose a data_type we can't validate the builders eagerly, but we can at least verify on finish

@tustvold tustvold force-pushed the validate-struct-array-fields branch from 2c2bfac to 080a6c9 Compare June 12, 2023 10:00
@@ -305,8 +287,8 @@ mod tests {
let int_builder = Int32Builder::new();

let fields = vec![
Field::new("f1", DataType::Utf8, false),
Field::new("f2", DataType::Int32, false),
Field::new("f1", DataType::Utf8, true),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The builder will now also verify nullability

@tustvold tustvold changed the title StructBuilder validate child types (#4397) StructBuilder Validate Child Data (#4397) Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

StructBuilder::new Doesn't Validate Builder DataTypes
2 participants