ErrorsReads and writes · rule
query.aggregate_argument
Aggregate is given the wrong arguments.
Area 6, Reads and writes; not declinable; the next step is usually the agent's.
type LeafCount = Int { min: 1}entity Book { id: Uuid leaves: LeafCount}type ShelfLength = Output { mean_leaves: Decimal?}query shelf_length() -> ShelfLength { from: Book aggregate: { mean_leaves: average(Book.leaves) }}
error average needs scale: and rounding:
--> main.jadpo:17:22
|17 | mean_leaves: average(Book.leaves) | ^^^^^^^^^^^^^^^^^^^^ wrong arguments
- reason
- An average rarely comes out exact, so it says how many places it keeps and how the last one is rounded, both written out:
average(Book.<field>, scale: 2, rounding: Rounding.half_even). - next
- Add
scale:androunding:(agent) - rule
- query.
aggregate_ argument - help
- https://jadpo.
dev/docs/errors/query. aggregate_ argument
Markdown for agents: /docs/errors/query.aggregate_argument.md.Built from Jadpo main at aee2e8f.