alamb commented on code in PR #3965:
URL: https://github.com/apache/arrow-rs/pull/3965#discussion_r1152504885
##########
arrow-array/src/builder/struct_builder.rs:
##########
@@ -487,14 +494,14 @@ mod tests {
#[test]
fn test_datatype_properties() {
- let fields = vec![
+ let fields = Fields::from(vec![
Field::new("f1", DataType::Decimal128(1, 2), false),
Field::new(
"f2",
DataType::Timestamp(TimeUnit::Millisecond,
Some("+00:00".to_string())),
false,
),
- ];
+ ]);
let mut builder = StructBuilder::from_fields(fields.clone(), 1);
Review Comment:
I wonder if we could have `StructBuilder::from_fields` take a `impl
Into<Fields>` here rather than having to change all callsites.
##########
arrow-integration-test/src/schema.rs:
##########
@@ -178,10 +181,10 @@ mod tests {
),
Field::new(
"c25",
- DataType::Struct(vec![
+ DataType::Struct(Fields::from(vec![
Review Comment:
For anyone who uses `DataType::Struct` this is now getting complicated to
construct
I wonder if we can ease the pain by having something
```rust
impl DataType {
fn new_struct(fields: impl Into<Fields>) -> Self {
..
}
```
So then this could be
```suggestion
DataType::new_struct(vec![
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]