ErrorsBackground work · rule
type.batch_row_invalid
A file helper's rows can't be read as the type its as: names or from where its items_at: says, its max_unpacked_size: isn't a size, or its rows can't be written as the row its each: gives.
Area 12, Background work; not declinable; the next step is usually the agent's.
A file helper reads each row as the Input its as: names, and writes
each as the Output its each: gives. A CSV or TSV row
holds one value a cell, so a row type holding a list, a map, an object
or a standard type with no one text form is refused, pointing at JSON
Lines, whose rows hold any JSON value; so is a row type that isn't an
Input (or, written, an Output), or two fields reading or writing one
column. The same rule refuses json.read's items_at:
when it isn't member names written out between dots ("data.items"),
and a reader's max_unpacked_size: when it isn't a size (200mb):
use bakery/types { OrderCode }/// One order a sheet lists, with its lines.type OrderRow = Input { reference: OrderCode lines: List<OrderCode>}
use bakery/entities { OrderSheet, OrderSheetNotFound }use bakery/types { OrderRow }use bakery/actions { take_order }/// Starts taking the orders a kept sheet lists.action read_orders(sheet_id: OrderSheet.id) fails OrderSheetNotFound -> BatchRun { var order_sheet: OrderSheet = attempt OrderSheet.get(sheet_id) return csv.read(order_sheet.sheet, as: OrderRow, each: order_entry -> take_order(order_entry))}
error csv.read can't read its rows as OrderRow
--> domains/bakery/actions/read_orders.jadpo:8:44
|8 | return csv.read(order_sheet.sheet, as: OrderRow, each: order_entry -> take_order(order_entry)) | ^^^^^^^^ `OrderRow.lines` holds a list
- reason
- A CSV row holds one value a cell, and
OrderRow.linesholds a list; a JSON Lines row holds lists and objects, each line one JSON value. - next
- Read the file with
json_lines.read, or givelinesa type one cell holds (agent) - rule
- type.
batch_ row_ invalid - help
- https://jadpo.
dev/docs/errors/type. batch_ row_ invalid
Markdown for agents: /docs/errors/type.batch_row_invalid.md.Built from Jadpo main at aee2e8f.