From 262449abe3e5ed9f57084689ea7ab676057e9103 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Tue, 3 Mar 2026 20:32:17 -0600 Subject: [PATCH] =?UTF-8?q?store:=20Fix:=20get=5Fone=5Fplayer=20CSV=20miss?= =?UTF-8?q?ing=20data=20row=20=E2=80=94=20to=5Fcsv()=20called=20before=20a?= =?UTF-8?q?ppend()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ng-data-row-to-csv-called-before-1fca0a.md | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 graph/fixes/fix-get-one-player-csv-missing-data-row-to-csv-called-before-1fca0a.md diff --git a/graph/fixes/fix-get-one-player-csv-missing-data-row-to-csv-called-before-1fca0a.md b/graph/fixes/fix-get-one-player-csv-missing-data-row-to-csv-called-before-1fca0a.md new file mode 100644 index 00000000000..f17102c0d56 --- /dev/null +++ b/graph/fixes/fix-get-one-player-csv-missing-data-row-to-csv-called-before-1fca0a.md @@ -0,0 +1,25 @@ +--- +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:17.214021+00:00" +--- + +## 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)