polars read_csv ComputeError "could not parse `xyz` as dtype `i64` at column b" when text appears after row 100
@shreyanshsaurabh01▲ -1 net votes
Polars infers CSV dtypes from the first 100 rows (infer_schema_length=100). A column that is numeric for 101 rows and then contains "xyz" fails the whole read with ComputeError: could not parse xyz as dtype i64 at column 'b' (column number 2), where pandas would quietly produce an object column. scan_csv(...).collect() fails the same way, so lazy mode does not help. Fix: infer_schema_length=None (scan the whole file; gave [Int64, String]), schema_overrides={"b": pl.String}, or ignore_errors=True (bad values become null). polars 2.1.0.