Step 5: Examples and Evaluations
Why Add Examples?
5a: Writing Evaluation Test Cases
test_cases:
- type: SQL
name: active_customer_count
description: |-
Count of active Grove customers.
Evaluation:
- entity knowledge to filter status = 'active'
- task instructions to exclude test accounts (is_test_account = false) and deleted accounts (is_deleted = false)
input: How many active customers do we have?
expected_output: |-
SELECT
METRIC('count_customers') AS customer_count
FROM customer
WHERE status = 'active'
AND is_test_account = false
AND is_deleted = false
tags:
difficulty: EASY
domain: default
eval: entity_knowledge
- type: SQL
name: arr_by_plan_type
description: |-
Total ARR grouped by plan type for active customers.
Evaluation:
- task instructions to use arr field, not total_paid
- task instructions to exclude test and deleted accounts
input: What is our ARR breakdown by plan type?
expected_output: |-
SELECT
plan_type,
METRIC('total_arr') AS arr,
METRIC('count_customers') AS customers
FROM customer
WHERE status = 'active'
AND is_test_account = false
AND is_deleted = false
GROUP BY 1
ORDER BY 2 DESC
tags:
difficulty: EASY
domain: default
eval: task_instructions
- type: SQL
name: logo_churn_this_quarter
description: |-
Logo churn rate for the current fiscal quarter.
Evaluation:
- domain knowledge for fiscal quarter definition (Q1 = Feb–Apr)
- glossary: logo_churn = count of churned accounts, not revenue
- task instructions to exclude test and deleted accounts
input: What is our logo churn rate this quarter?
expected_output: |-
SELECT
METRIC('churn_rate') AS logo_churn_rate
FROM customer
WHERE churn_date >= '2026-02-01'
AND churn_date < '2026-05-01'
AND is_test_account = false
AND is_deleted = false
tags:
difficulty: MEDIUM
domain: default
eval: domain_knowledge
- type: SQL
name: mrr_at_risk_pending_cancellations
description: |-
Total MRR at risk from active subscriptions with a scheduled cancellation before renewal.
Evaluation:
- feature chaining: mrr_at_risk metric pulled from subscription entity
- entity knowledge: is_pending_cancellation flag defined on subscription
input: How much MRR is at risk from pending cancellations?
expected_output: |-
SELECT
METRIC('mrr_at_risk') AS mrr_at_risk
FROM subscription
WHERE status = 'active'
AND is_pending_cancellation = true
tags:
difficulty: MEDIUM
domain: default
eval: feature_chaining5b: Running Evaluations
Key Point
Last updated