You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/10/01 15:50:20 UTC

[GitHub] [arrow] jorgecarleitao commented on a change in pull request #8225: ARROW-10046: [Rust] [DataFusion] Made `RecordBatchReader` implement Iterator

jorgecarleitao commented on a change in pull request #8225:
URL: https://github.com/apache/arrow/pull/8225#discussion_r498348983



##########
File path: rust/arrow-flight/src/utils.rs
##########
@@ -129,21 +129,29 @@ impl TryFrom<&SchemaResult> for Schema {
 pub fn flight_data_to_arrow_batch(
     data: &FlightData,
     schema: SchemaRef,
-) -> Result<Option<RecordBatch>> {
+) -> Option<Result<RecordBatch>> {

Review comment:
       Yes, that is the reason. we could [`transpose`](https://doc.rust-lang.org/std/result/enum.Result.html#method.transpose) these operations elsewhere, but the gist is that the iterator `next` needs the `Option` to come first (which is not very user-friendly as it limits the usage of `?`)




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org