The Gene Named September 2nd — Python Bug Hunt
Inspired by the genomics community literally renaming 27 human genes (SEPT2 → SEPTIN2, MARCH1 → MARCHF1…) because Excel kept auto-converting them to dates,…
- Language: Python
- Layer: Backend
- Difficulty: Medium
- Concepts: Coercion, Data Import
- Modelled on: Excel × genomics
- Visible tests: plain integers convert; scientific-notation lookalikes stay strings; leading zeros mean identifier
- Reward: 50 XP for a complete fix
Incident
- Severity: SEV-2 (priority: High (data integrity))
- Ticket: BUG-SEPT2
- Reported by: research tools
- Time to fix: 20 minutes, the target for a medium incident
Failing checks on the shipped build
- scientific-notation lookalikes stay strings — expected "1E5" but got 100000
- leading zeros mean identifier — expected "007" but got 7
How to work this incident
- Read the report: write down the expected behaviour and the actual one in a sentence each.
- Reproduce it: run the visible tests and find the failing check that matches the report.
- Read the logs and the failing checks for the first value that is wrong — the earliest wrong value is nearer the cause than the loudest error.
- Follow the request through the handler, the validation and the service it calls; find the first step whose output disagrees with the report.
- Fix the cause rather than the symptom, run the visible tests again, and submit against the hidden ones — then write the root cause down.
Briefing
Inspired by the genomics community literally renaming 27 human genes (SEPT2 → SEPTIN2, MARCH1 → MARCHF1…) because Excel kept auto-converting them to dates, and scientific-notation lookalikes like "1E5" to numbers. Roughly a fifth of published gene lists carried the corruption.
cells.py imports spreadssheet cells. Convert only what is unambiguously a number.
Bug report
BUG-SEPT2 · Priority: High (data integrity) · Reported by: research tools
parse_cell(value) rules:
- pure integers ("42", "-7") -> int … EXCEPT leading zeros ("007" is an ID!)
- pure decimals ("3.14") -> float
- EVERYTHING else stays a string: "SEPT2", "1E5", "007", "3/4"
Observed: "1E5" imports as 100000.0 and "007" as 7 — identifiers destroyed.
Logs
[import] "1E5" -> 100000.0
[import] "007" -> 7The code as shipped
src/import/cells.py (editable)
# Parses a raw spreadsheet cell into int / float / str.
def parse_cell(value):
try:
number = float(value)
if number == int(number):
return int(number)
return number
except ValueError:
return value
Open the hunt to start the incident clock, edit the files, run the visible tests and submit against the hidden ones, then write the root cause down. More Python bug hunts.