claude-memory/graph/fixes/fix-dead-roster-csv-fields-in-paper-dynasty-database-cards-e-61b618.md

2.3 KiB
Raw Blame History

id type title tags importance confidence created updated relations
61b618e7-6c6a-46be-9dec-b31b57cb19fe fix Fix: dead roster CSV fields in paper-dynasty-database cards endpoint
paper-dynasty
paper-dynasty-database
fastapi
python
fix
dead-code
csv
card-model
0.55 0.8 2026-03-03T18:07:05.018372+00:00 2026-03-03T19:37:40.283018+00:00
target type direction strength edge_id
fb56ad2c-5c87-48d4-8a69-118c81f74884 BUILDS_ON outgoing 0.7 4b12f41f-ac18-4ea9-81c3-17f9b99b9d2a
target type direction strength edge_id
1e6628fa-dc5d-4047-a9ae-ecb884e04ba2 RELATED_TO outgoing 0.69 caec4168-dea7-45bc-b10c-ed8baf816768
target type direction strength edge_id
25a63239-d077-4a92-8466-0900e16b837f RELATED_TO outgoing 0.68 7f19347f-52cb-4d65-a5a3-61e8670d3d5a
target type direction strength edge_id
62d0f73d-8854-4c71-9001-60b38d438534 RELATED_TO incoming 0.82 06b45144-877b-4e26-bad5-b479fa53e6c0
target type direction strength edge_id
a08cfd86-d519-41cd-b93e-0877e11c7cc3 RELATED_TO incoming 0.77 1b5c2d30-6668-41b4-a17c-cc2af2bb3105
target type direction strength edge_id
475fcd0d-8d29-471b-a6e3-f3face5320c9 RELATED_TO incoming 0.75 14902c20-b159-422e-bf42-ad47ff012b9c

Problem

app/routers_v2/cards.pyv1_cards_get_one endpoint's CSV branch accessed this_card.roster1.name, this_card.roster2.name, this_card.roster3.name. The Card model has no such fields, so any GET /api/v2/cards/{id}?csv=true request would raise AttributeError at runtime.

Root Cause

The CSV code was written against an older schema that had roster foreign keys on Card. Those fields were removed from the model but the CSV export code was never updated.

Solution

Removed the three dead columns from the CSV header row and data row. The output now reflects only fields that exist on Card: id, player, team, pack, value.

Files Changed

  • app/routers_v2/cards.py lines 144146

Note

The v1_cards_patch endpoint also accepts roster1_id, roster2_id, roster3_id params that are silently ignored (no assignment in handler body) — dead API surface but not a runtime error.

PR

cal/paper-dynasty-database#35