Skip to content

Commit

Permalink
fix(rust): Print error message on mmap IPC file only in verbose mode (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
zundertj committed Jan 7, 2023
1 parent 4e13a81 commit 2b9b3df
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions polars/polars-io/src/ipc/ipc_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,17 +149,21 @@ impl<R: MmapBytesReader> IpcReader<R> {
}
match self.finish_memmapped(predicate.clone()) {
Ok(df) => return Ok(df),
Err(err) => match err {
PolarsError::ArrowError(e) => match e.as_ref() {
arrow::error::Error::NotYetImplemented(s)
if s == "mmap can only be done on uncompressed IPC files" =>
{
eprint!("could not mmap compressed IPC file, defaulting to normal read")
}
_ => return Err(PolarsError::ArrowError(e)),
},
err => return Err(err),
},
Err(err) => {
match err {
PolarsError::ArrowError(e) => match e.as_ref() {
arrow::error::Error::NotYetImplemented(s)
if s == "mmap can only be done on uncompressed IPC files" =>
{
if verbose {
eprint!("could not mmap compressed IPC file, defaulting to normal read")
}
}
_ => return Err(PolarsError::ArrowError(e)),
},
err => return Err(err),
}
}
}
}
let rechunk = self.rechunk;
Expand Down

0 comments on commit 2b9b3df

Please sign in to comment.