Sample - Claims Summary

Up: HVE Sample Labs · Audience: Learner Personas · Evaluation: Competency and Evaluation Goals

Goal and Scenario

An insurer needs a reliable status summary from synthetic claims rows. Implement summarize_claims(rows) in HVE Samples/claims-summary/starter.py. Proposed time: 30–45 minutes, untested with learners. This is a local data-engineering exercise; it does not call Fabric or Foundry.

Data Contract

Input is a list of dictionaries such as those returned by csv.DictReader. Each row has a unique, nonblank string claim_id, an exact status of new, review, or closed, and an amount string representing a positive finite decimal with at most two decimal places. Whitespace-only IDs are invalid; otherwise IDs are compared exactly without normalization. Missing fields, duplicate IDs, unknown statuses, and invalid amounts raise ValueError for the entire call. Unknown fields may be ignored. Do not mutate input rows.

Return all three status groups, each with count and total_amount. Amount totals must be decimal-accurate strings formatted with two places. Empty input returns zero counts and 0.00 totals. Do not silently skip malformed rows or round extra precision.

Learner Workflow

Inspect the fixture and state why binary floating-point may be unsuitable for money totals. Resolve that bounded evidence gap if necessary. Plan, implement, and validate aggregation plus rejection behavior. Explain what should happen when an invalid row appears after valid rows.

Run and Success Check

From HVE Samples/claims-summary/, run python3 checks.py starter.py. The provided CSV should produce: new = 2 / 11.00; review = 1 / 20.10; closed = 1 / 5.00. The initial starter deliberately fails. Submit requirements/plan references, changed code, actual check output, and acceptance disposition.

Instructor reference: instructor_solution.py; exclude it from learner packaging. Review exactness, invalid-row handling, empty input, and input preservation. Reference checks do not replace an explanation of the data contract.

Variations

Guided: inspect and explain expected totals with a partner. Independent: implement the contract. Adaptive: propose a large-file streaming version and state which semantics and failure behavior must remain unchanged.