polars::prelude::schema_inference

Function infer_file_schema

Source
pub fn infer_file_schema(
    reader_bytes: &ReaderBytes<'_>,
    separator: u8,
    max_read_rows: Option<usize>,
    has_header: bool,
    schema_overwrite: Option<&Schema<DataType>>,
    skip_rows: usize,
    skip_rows_after_header: usize,
    comment_prefix: Option<&CommentPrefix>,
    quote_char: Option<u8>,
    eol_char: u8,
    null_values: Option<&NullValues>,
    try_parse_dates: bool,
    raise_if_empty: bool,
    n_threads: &mut Option<usize>,
    decimal_comma: bool,
) -> Result<(Schema<DataType>, usize, usize), PolarsError>
Available on crate feature polars-io only.
Expand description

Infer the schema of a CSV file by reading through the first n rows of the file, with max_read_rows controlling the maximum number of rows to read.

If max_read_rows is not set, the whole file is read to infer its schema.

Returns - inferred schema - number of rows used for inference. - bytes read