The task and original case
Create an import report that catches a missing currency field before a monetary total is calculated. The exercise is a schema decision, not merely a column-renaming task. A number without its unit or currency can look valid while remaining unusable for the intended analysis.
| Case element | Value or requirement |
|---|---|
| Inputs | Required headers id,amount,currency. Incoming file has id,amount and an unexpected fee column. |
| Build | A schema report and a controlled import decision, with retained raw inputs. |
This is an original invented exercise. It is independent practice, with no employer assessment or open-vacancy claim. Download the inputs, attempt your own result, then open the separate answer key.
Data and worked inputs
Build a result another person can follow
Declare required headers id, amount and currency. Keep an allowed optional-header list separately; for this case, fee is unexpected. Read the incoming header with Python's CSV tools, compare normalized names under a written normalization rule and calculate missing and unexpected sets before reading values into the analysis.
The supplied file has id, amount and fee. Quarantine it because currency is missing. Save the original header and report both issues rather than pretending the extra field compensates for the absent one. Python's CSV documentation covers header-based reading; your required-schema policy is an explicit choice for this authored exercise. A schema pass would still need later identity, type and currency-value checks.
Sources[1]
Check the worked result
The missing set contains currency and the unexpected set contains fee. The import report should say that no combined monetary total was produced. It should identify the required schema, observed header and affected source file so another person can repair the right thing.
Do not default currency to USD simply because the values have no symbol. The fixture supplies no evidence for that assumption. Likewise, do not silently subtract fee: its meaning and whether amount already includes it are unspecified.
Make the failure visible
Test a duplicate amount header and a visually similar header with trailing space. A duplicate can overwrite data in a dictionary-style reader, so detect it before relying on header-based lookup. Decide whether trimming is allowed and retain the raw-to-normalized mapping. Also test a corrected schema with a nonnumeric amount; passing the header gate must not bypass value validation.
Revise it and ask someone to reproduce it
Give a peer the report and ask them to repair the file without changing the amount values. In revision two, accept a supplied currency column and explicitly decide whether fee is now allowed. Keep both schema receipts. The improvement is a documented controlled import, not an invented financial result.
- Missing currency and unexpected fee are both reported.
- No total is created before schema and value gates pass.
- Raw headers and any normalization mapping remain available.
Describe the work accurately
After completing your own version, you could adapt this project bullet: “Created a controlled CSV import exercise with required-column checks, duplicate-header detection and explicit quarantine before monetary aggregation.”
Use Projects or Independent practice as the heading. Keep the input files, result and revision together. Describe only your own completed work; the invented numbers are model outputs, not employer results or measured business impact.