claude-memory/graph/fixes/fix-remove-dead-roster-fields-from-csv-in-paper-dynasty-data-573491.md

2.2 KiB

id type title tags importance confidence created updated relations
573491c4-cced-4400-8029-84d6298df631 fix Fix: Remove dead roster fields from CSV in paper-dynasty-database v1_cards_get_one
paper-dynasty-database
fastapi
python
fix
dead-code
csv
peewee
0.5 0.8 2026-03-03T20:36:36.060493+00:00 2026-03-04T02:32:18.715278+00:00
target type direction strength edge_id
62d0f73d-8854-4c71-9001-60b38d438534 RELATED_TO outgoing 0.82 4f6cbe71-f2a1-4d28-8c54-66031407ee40
target type direction strength edge_id
0fdd32ea-6b6a-4cd0-aa4b-117184e0c81d RELATED_TO outgoing 0.87 bd40401a-c8ac-49f7-9b5e-bbb880b0ae50
target type direction strength edge_id
b9375a89-6e0f-4722-bca7-f1cd655de81a RELATED_TO outgoing 0.87 72bc9a13-dd0d-43ba-baff-5c5071a56a88
target type direction strength edge_id
1fca0ae0-681e-4755-b16c-e5661639c6ef RELATED_TO incoming 0.72 fd1ddeee-eead-45c8-bfeb-97ceb828e325

Problem

v1_cards_get_one in app/routers_v2/cards.py included roster1, roster2, roster3 in the CSV output. Accessing this_card.roster1.name etc. raises AttributeError at runtime because the Card model has no roster fields.

Root Cause

Dead code referencing non-existent model fields. The Card model only has player, team, pack, value fields.

Fix

Removed the three roster columns from both the CSV header list and the 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

Notes

  • Ruff linter hook auto-reformats the entire file on save (single → double quotes, line wrapping) — large diff but small functional change.
  • v1_cards_patch still accepts roster1_id/roster2_id/roster3_id params that are silently ignored — dead API surface for a separate cleanup.