pola-rs/polars · error

could not read

Error message

could not read

What it means

Error "could not read" thrown in pola-rs/polars.

Source

Thrown at crates/polars-io/src/mmap.rs:101

impl<'a, T: 'a + MmapBytesReader> From<&'a mut T> for ReaderBytes<'a> {
    fn from(m: &'a mut T) -> Self {
        match m.to_bytes() {
            // , but somehow bchk doesn't see that lifetime is 'a.
            Some(s) => {
                let s = unsafe { std::mem::transmute::<&[u8], &'a [u8]>(s) };
                ReaderBytes::Borrowed(s)
            },
            None => {
                if let Some(f) = m.to_file() {
                    let mmap = MMapSemaphore::new_from_file(f).unwrap();
                    ReaderBytes::Owned(Buffer::from_owner(mmap))
                } else {
                    if verbose() {
                        eprintln!("could not memory map file; read to buffer.")
                    }
                    let mut buf = vec![];
                    m.read_to_end(&mut buf).expect("could not read");
                    ReaderBytes::Owned(Buffer::from_vec(buf))
                }
            },
        }
    }
}

View on GitHub (pinned to df599052da)

When it happens

Trigger: Thrown at crates/polars-io/src/mmap.rs:101 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of pola-rs/polars@df599052da (2026-08-16). Data as JSON: /api/errors/a530393e4a4ea12e. Report an issue: GitHub.