Skip to content
This repository was archived by the owner on Dec 29, 2021. It is now read-only.

Commit 5a495b2

Browse files
committed
RecordBatch::try_new
1 parent 00b8f14 commit 5a495b2

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/dataframe.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ impl DataFrame {
135135

136136
arrays.into_iter().for_each(|array| {
137137
dbg!(array.len());
138-
batches.push(RecordBatch::new(self.schema.clone(), array));
138+
// the unwrap is infallible as we're passing data that's already been verified
139+
batches.push(RecordBatch::try_new(self.schema.clone(), array).unwrap());
139140
});
140141

141142
batches

src/io/feather.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ impl<R: Read + Seek> FeatherReader<R> {
386386
};
387387
}
388388

389-
Ok(RecordBatch::new(Arc::new(Schema::new(fields)), arrays))
389+
Ok(RecordBatch::try_new(Arc::new(Schema::new(fields)), arrays)?)
390390
}
391391
}
392392

0 commit comments

Comments
 (0)