claude-memory/graph/fixes/fix-get-one-player-csv-missing-data-row-to-csv-called-before-1fca0a.md

42 lines
1.5 KiB
Markdown

---
id: 1fca0ae0-681e-4755-b16c-e5661639c6ef
type: fix
title: "Fix: get_one_player CSV missing data row — to_csv() called before append()"
tags: [paper-dynasty, python, fastapi, pandas, csv, bug, fix]
importance: 0.6
confidence: 0.8
created: "2026-03-04T02:32:17.214021+00:00"
updated: "2026-03-04T02:32:18.788103+00:00"
relations:
- target: 573491c4-cced-4400-8029-84d6298df631
type: RELATED_TO
direction: outgoing
strength: 0.72
edge_id: fd1ddeee-eead-45c8-bfeb-97ceb828e325
- target: 6ebf27b5-c1eb-4e4d-b12a-62e7fdbc9406
type: RELATED_TO
direction: outgoing
strength: 0.73
edge_id: 9a4dc69d-c029-4950-95d8-62fc39a88852
- target: 1e0e14cd-588f-417d-8fcb-a48a6cca506d
type: RELATED_TO
direction: outgoing
strength: 0.72
edge_id: 503f985c-3a59-44f8-a5ea-254cf145a78f
---
## Problem
`get_one_player` in `app/routers_v2/players.py` returned a CSV response containing only the header row — player data was never included.
## Root Cause
`return_val = DataFrame(data_list).to_csv(header=False, index=False)` was called on line 625 when `data_list` contained only the header list. The player data row was appended to `data_list` on line 626 — after the CSV was already computed.
## Solution
Moved the `to_csv()` call to after `data_list.append(player_row)`. Single-line swap, no logic changes.
## Files Changed
- `app/routers_v2/players.py` (~line 625-651)
## PR
https://git.manticorum.com/cal/paper-dynasty-database/pulls/51 (issue #12)