baml.csv.Error

A CSV error with positional diagnostics.

Reference version

Signature

class baml.csv.Error

A CSV error with positional diagnostics.

kind is for portable handling. line, record, field, and column make "row 41,283 has 7 fields, expected 8" cheap to report.

Every positional field is optional, because not every error has a position: a bad option is caught before parsing starts, and NotFound / TooManyRows are about the input as a whole. They narrow as the failure does — line and record whenever a record is in hand, field and column when one cell is at fault, expected and found only for FieldCount.

Source:<builtin>/baml/ns_csv/csv.bamlbytes 2305–2748

Fields

message

string

line

int | null

1-based line in the source where the offending record starts.

record

int | null

0-based data-record index (header excluded).

field

int | null

0-based field index within the record.

column

string | null

Header name, when known.

expected

int | null

FieldCount: expected width.

found

int | null

FieldCount: actual width.

Implementations

baml.Concrete for T

Source:<builtin>/baml/core.bamlbytes 763–795