claude-memory/graph/fixes/fix-removed-dead-roster-fields-from-csv-in-paper-dynasty-dat-62d0f7.md

2.4 KiB

id type title tags importance confidence created updated relations
62d0f73d-8854-4c71-9001-60b38d438534 fix Fix: removed dead roster fields from CSV in paper-dynasty-database v1_cards_get_one
paper-dynasty-database
python
fastapi
fix
csv
dead-code
cards
0.5 0.8 2026-03-03T19:06:18.393440+00:00 2026-03-03T20:36:36.631086+00:00
target type direction strength edge_id
61b618e7-6c6a-46be-9dec-b31b57cb19fe RELATED_TO outgoing 0.82 06b45144-877b-4e26-bad5-b479fa53e6c0
target type direction strength edge_id
b1eb1655-e006-447d-a0cf-bba7a914b331 RELATED_TO outgoing 0.78 b4aad7b7-3664-4ed7-887c-389cacc7d265
target type direction strength edge_id
1e0e14cd-588f-417d-8fcb-a48a6cca506d RELATED_TO outgoing 0.94 62b830d7-95b3-493e-bca7-04cdc6e56229
target type direction strength edge_id
573491c4-cced-4400-8029-84d6298df631 RELATED_TO incoming 0.82 4f6cbe71-f2a1-4d28-8c54-66031407ee40

Problem

v1_cards_get_one in app/routers_v2/cards.py had a CSV branch that referenced this_card.roster1.name, this_card.roster2.name, and this_card.roster3.name — none of which exist on the Card model. Any GET /api/v2/cards/{card_id}?csv=true request would raise AttributeError at runtime.

Root Cause

Dead fields left over from an older schema design; the Card model only has player, team, pack, value (plus id).

Solution

Removed the three non-existent roster columns from both the CSV header row and data row:

# Before
data_list = [
    ['id', 'player', 'team', 'pack', 'value', 'roster1', 'roster2', 'roster3'],
    [..., this_card.roster1.name, this_card.roster2.name, this_card.roster3.name]
]

# After
data_list = [
    ['id', 'player', 'team', 'pack', 'value'],
    [this_card.id, this_card.player, this_card.team.abbrev, this_card.pack, this_card.value]
]

Files Changed

  • app/routers_v2/cards.py — lines ~144-146

Notes

  • The v1_cards_patch endpoint still accepts roster1_id, roster2_id, roster3_id params that are silently ignored — dead API surface, tracked separately.
  • Project has a ruff linter hook that auto-reformats files on edit (single→double quotes, line wrapping). The functional diff was just the roster field removal.

PR

PR #36: cal/paper-dynasty-database#36 Issue #35