alamb commented on code in PR #3953:
URL: https://github.com/apache/arrow-rs/pull/3953#discussion_r1154542001
##########
arrow-array/src/record_batch.rs:
##########
@@ -447,23 +447,28 @@ impl Default for RecordBatchOptions {
Self::new()
}
}
+impl From<StructArray> for RecordBatch {
+ fn from(value: StructArray) -> Self {
+ assert_eq!(
+ value.null_count(),
+ 0,
+ "Cannot convert nullable StructArray to RecordBatch"
Review Comment:
> panicking if you violate that invariant seems perfectly reasonable to me...
Is this invariant documented anywhere? I am just thinking of some case where
the code "used to work" ( I realize not correctly) and now it still compiles
but panic's at runtime.
Maybe we can just document the invariant better -- and I suppose as long as
there is a workaround it should be fine
--
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]