CSV Quality Report
ivy.agent.csv-quality-report · v1.0.0
ivyx
Checks every row of an orders CSV against a schema and writes a report of the rows with problems and the valid rows per country, with no model involved.
Steps
In the order the agent's file lists them, each with where its inputs come from and the values the file fixes. A branch or a loop is a step too.
- 01Ivy NodeRead the CSVivy.node.csv-read
Reads a CSV file, or CSV text, into rows with the column names and row count.
- takes
pathfrom the agent's input- returns
row_count
- 02Ivy NodeCheck every rowivy.node.rows-validate
Checks every row against a JSON Schema and splits the rows into valid ones and invalid ones with their problems.
- takes
rowsfrom step 1- set
schema{"type":"object","required":["order_id","customer","quantity","unit_price","status"],"properties":{"order_id":{"type"...- returns
error_count,invalid_rows
- 03Ivy NodeCount valid rows per countryivy.node.table-aggregate
Groups rows and sums, averages, counts or takes the minimum or maximum of one column, optionally by month, year or day of a date column.
- takes
rowsfrom step 2,valid_rows- set
group_bycountryopcount- returns
by_country
- 04Ivy NodeLay out the problem rowsivy.node.markdown-table
Formats rows as a Markdown table, with the columns in the order given or as they first appear.
- takes
rowsfrom step 2,invalid_rows- set
columns["order_id","customer","problems"]
- 05Ivy NodeLay out the country countsivy.node.markdown-table
Formats rows as a Markdown table, with the columns in the order given or as they first appear.
- takes
rowsfrom step 3
- 06Ivy NodeAssemble the reportivy.node.template-render
Fills {{ name }} placeholders in a text template from a mapping, and reports which names were missing.
- takes
values.filefrom the agent's input,pathvalues.error_countfrom step 2,error_countvalues.row_countfrom step 1,row_countvalues.problemsfrom step 4,markdownvalues.by_countryfrom step 5,markdown- set
template# CSV quality report File: {{ file }} {{ error_count }} of {{ row_count }} rows have a problem. ## Rows with problems...on_missingempty- returns
report
- 07Ivy NodeWrite the reportivy.node.file-write
Writes text to a file, creating its folder, and returns the absolute path and the number of bytes written.
- takes
textfrom step 6- set
pathreports/csv-quality.mdoverwritetrue- returns
path
Nodes it brings
Adding this agent in IVYX Studio adds these nodes with it. A node your workspace already has is kept as it is, even at another version.
What it touches
Collected from what each of its nodes declares, plus the model call when a step is a model turn. A declaration is the author's statement, and it is what policy rules select on.
Inputs
| Field | Type | Description |
|---|---|---|
| pathrequired | string | Path to the orders CSV, with the columns order_id, customer, country, quantity, unit_price and status. |
Outputs
| Field | Type | Description |
|---|---|---|
| row_count | integer | How many rows the file has. |
| error_count | integer | How many rows had a problem. |
| invalid_rows | array | The rows with problems, each with its problems as one sentence. |
| by_country | array | The valid rows counted per country. |
| report | string | The report that was written. |
| path | string | The file the report was written to. |
Tests
2 of 2 test cases passed on Oct 4, 2026, in the publisher's own environment, before this version was published. The registry keeps that record; it does not run the cases again.
Requires: python:3.9
- four-bad-rows
Six orders, four with a problem: a missing quantity, a negative one, an unknown status and a missing customer.
- given
pathdata/showcase/orders.csv- expects
row_countequals 6error_countequals 4reportmatches O-1002[\s\S]*O-1003[\s\S]*O-1004[\s\S]*O-1006pathmatches reports/csv-quality\.md$
- clean-file
A clean file has no problem row and still counts its countries.
- given
pathdata/showcase/orders-clean.csv- expects
row_countequals 3error_countequals 0reportmatches 0 of 3 rows