sgilmore10 commented on a change in pull request #10305: URL: https://github.com/apache/arrow/pull/10305#discussion_r658827138
########## File path: matlab/src/feather_reader.cc ########## @@ -177,32 +182,32 @@ Status FeatherReader::Open(const std::string& filename, *feather_reader = std::shared_ptr<FeatherReader>(new FeatherReader()); // Open file with given filename as a ReadableFile. - std::shared_ptr<io::ReadableFile> readable_file(nullptr); - - RETURN_NOT_OK(io::ReadableFile::Open(filename, &readable_file)); + arrow::Result<std::shared_ptr<io::ReadableFile>> maybe_readable_file = + io::ReadableFile::Open(filename); // TableReader expects a RandomAccessFile. - std::shared_ptr<io::RandomAccessFile> random_access_file(readable_file); + ARROW_ASSIGN_OR_RAISE(std::shared_ptr<io::RandomAccessFile> random_access_file, + maybe_readable_file); // Open the Feather file for reading with a TableReader. - RETURN_NOT_OK(ipc::feather::TableReader::Open(random_access_file, - &(*feather_reader)->table_reader_)); - - // Read the table metadata from the Feather file. - (*feather_reader)->num_rows_ = (*feather_reader)->table_reader_->num_rows(); - (*feather_reader)->num_variables_ = (*feather_reader)->table_reader_->num_columns(); - (*feather_reader)->description_ = - (*feather_reader)->table_reader_->HasDescription() - ? (*feather_reader)->table_reader_->GetDescription() - : ""; - - if ((*feather_reader)->num_rows_ > internal::MAX_MATLAB_SIZE || - (*feather_reader)->num_variables_ > internal::MAX_MATLAB_SIZE) { - mexErrMsgIdAndTxt("MATLAB:arrow:SizeTooLarge", - "The table size exceeds MATLAB limits: %u x %u", - (*feather_reader)->num_rows_, (*feather_reader)->num_variables_); + arrow::Result<std::shared_ptr<ipc::feather::Reader>> maybe_reader = + ipc::feather::Reader::Open(random_access_file); + ARROW_ASSIGN_OR_RAISE(auto reader, maybe_reader); Review comment: Just made this change (with auto) in separate commit. -- 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org