#[non_exhaustive]pub enum IoError {
Show 29 variants
MissingHeaders,
CsvFieldCount {
line: usize,
expected: usize,
found: usize,
},
CsvUnterminatedQuote,
MissingIndexColumn(String),
DuplicateColumnName(String),
MissingUsecols(Vec<String>),
MissingParseDateColumns(Vec<String>),
JsonFormat(String),
Parquet(String),
Orc(String),
Hdf5(String),
Excel(String),
Html(String),
Xml(String),
Pickle(String),
Stata(String),
Sas(String),
Fwf(String),
Deferred(String),
Arrow(String),
Sql(String),
Clipboard(String),
Csv(Error),
Json(Error),
Io(Error),
Utf8(FromUtf8Error),
Column(ColumnError),
Frame(FrameError),
Index(IndexError),
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
MissingHeaders
CsvFieldCount
A CSV row carried MORE fields than the header declares.
Only the overlong direction is an error. pandas pads a SHORT row with
NA and raises only here — measured on 2.2.3:
read_csv("a,b,c\n1,2,3\n4,5\n") -> c = [3.0, NaN]
read_csv("a,b,c\n1,2,3\n4,5,6,7\n")
-> ParserError: Expected 3 fields in line 3, saw 4
The csv crate’s own UnequalLengths cannot be used for this because it
fires in BOTH directions (br-frankenpandas-fp-stricter-than-pandas-rejections-gtkz1).
CsvUnterminatedQuote
A quoted field was never closed before end of input.
pandas raises ParserError: EOF inside string starting at row N here.
The csv crate does NOT: it reads the unterminated field to EOF and
returns it. Under the strict (non-flexible) reader this surfaced only
incidentally, as an UnequalLengths field-count mismatch; once short
rows had to be padded (gtkz1) that accident disappeared, so the
condition is now detected directly.
MissingIndexColumn(String)
DuplicateColumnName(String)
MissingUsecols(Vec<String>)
MissingParseDateColumns(Vec<String>)
JsonFormat(String)
Parquet(String)
Orc(String)
Hdf5(String)
Excel(String)
Html(String)
Xml(String)
Pickle(String)
Stata(String)
Sas(String)
Fwf(String)
Deferred(String)
Arrow(String)
Sql(String)
Clipboard(String)
Csv(Error)
Json(Error)
Io(Error)
Utf8(FromUtf8Error)
Column(ColumnError)
Frame(FrameError)
Index(IndexError)
Trait Implementations§
Source§impl Error for IoError
impl Error for IoError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()