Skip to content

Commit

Permalink
chore: Returning error instead of using unreachable
Browse files Browse the repository at this point in the history
Signed-off-by: Xuanwo <[email protected]>
  • Loading branch information
Xuanwo committed Dec 23, 2024
1 parent e91fa31 commit 5510b48
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion parquet/src/arrow/async_reader/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,11 @@ where
pub async fn next_row_group(&mut self) -> Result<Option<ParquetRecordBatchReader>> {
loop {
match &mut self.state {
StreamState::Decoding(_) | StreamState::Reading(_) => unreachable!(),
StreamState::Decoding(_) | StreamState::Reading(_) => {
return Err(ParquetError::General(
"Cannot combine the use of next_row_group with the Stream API".to_string(),
))
}
StreamState::Init => {
let row_group_idx = match self.row_groups.pop_front() {
Some(idx) => idx,
Expand Down

0 comments on commit 5510b48

Please sign in to comment.