Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/agent/src/db.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
date,category,subcategory,amount,type,notes
2026-01-05,Revenue,Enterprise Subscriptions,45000,income,3 new enterprise customers (Acme Corp, TechFlow, DataViz Inc)
2026-01-05,Revenue,Enterprise Subscriptions,45000,income,"3 new enterprise customers (Acme Corp, TechFlow, DataViz Inc)"
2026-01-05,Revenue,Pro Tier Upgrades,12000,income,24 users upgraded from free to pro
2026-01-08,Revenue,API Usage Overages,3500,income,High API usage from top 5 customers
2026-01-10,Expenses,Engineering Salaries,42000,expense,7 engineers + 2 contractors
Expand Down
8 changes: 8 additions & 0 deletions apps/agent/tests/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,11 @@ def test_sample_query_returns_independent_rows():
first['rows'][0]['injected'] = 'changed'
second = query_data.invoke({'query': 'all'})
assert 'injected' not in second['rows'][0]


def test_sample_rows_parse_into_the_header_columns():
rows = query_data.invoke({'query': 'all'})['rows']
columns = ['date', 'category', 'subcategory', 'amount', 'type', 'notes']
# An unquoted comma in a field would shift values and add a None key.
assert all(list(row) == columns for row in rows)
assert rows[0]['notes'] == '3 new enterprise customers (Acme Corp, TechFlow, DataViz Inc)'