kjaymiller / kjaymiller/fire-map
One malformed detection field aborts the entire scan's insert
- Dominant language
- Python
- Stars
- 5
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
**File:** src/db/postgres.py:89 (feature_to_row / insert_detections)
`feature_to_row()` does unguarded `float()`/dict-key access for every detection inside `insert_detections()`'s list comprehension, which is built before any DB call.
**Failure scenario:** A single detection in a fetch has an empty/non-numeric `bright_ti4` or `frp` field, or is missing a key. The list comprehension raises `ValueError`/`KeyError` before `executemany` ever runs. This propagates uncaught out of `reload_data()`, so `cache.set_current()` never runs and every other valid detection in that same fetch is dropped along with it.
**Category:** correctness
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in src/db/postgres.py at feature_to_row and insert_detections, then trace how reload_data handles their result. Verify the behavior with a fetch containing one malformed or missing detection field: valid detections should still be inserted, and reload_data should continue far enough for cache.set_current() to run.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgres, python
- Domain
- database
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100