From 61736f7834664a46a35325d5ad20b7e3b0b194f0 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Tue, 3 Mar 2026 14:36:36 -0600 Subject: [PATCH] store: Fix: Remove dead roster fields from CSV in paper-dynasty-database v1_cards_get_one --- ...s-from-csv-in-paper-dynasty-data-573491.md | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 graph/fixes/fix-remove-dead-roster-fields-from-csv-in-paper-dynasty-data-573491.md diff --git a/graph/fixes/fix-remove-dead-roster-fields-from-csv-in-paper-dynasty-data-573491.md b/graph/fixes/fix-remove-dead-roster-fields-from-csv-in-paper-dynasty-data-573491.md new file mode 100644 index 00000000000..30942f36220 --- /dev/null +++ b/graph/fixes/fix-remove-dead-roster-fields-from-csv-in-paper-dynasty-data-573491.md @@ -0,0 +1,47 @@ +--- +id: 573491c4-cced-4400-8029-84d6298df631 +type: fix +title: "Fix: Remove dead roster fields from CSV in paper-dynasty-database v1_cards_get_one" +tags: [paper-dynasty-database, fastapi, python, fix, dead-code, csv, peewee] +importance: 0.5 +confidence: 0.8 +created: "2026-03-03T20:36:36.060493+00:00" +updated: "2026-03-03T20:36:36.060493+00:00" +--- + +## 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:** +```python +data_list = [ + ['id', 'player', 'team', 'pack', 'value', 'roster1', 'roster2', 'roster3'], + [..., this_card.roster1.name, this_card.roster2.name, this_card.roster3.name] +] +``` + +**After:** +```python +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.