From 0f7c0a7e59e70cac8f98536eda5d266a71bf6631 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Wed, 25 Feb 2026 16:26:37 -0600 Subject: [PATCH] store: Fix: Float/Decimal type mismatch in card builders (card-creation repo) --- ...-mismatch-in-card-builders-card-creatio-52e4aa.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 graph/fixes/fix-floatdecimal-type-mismatch-in-card-builders-card-creatio-52e4aa.md diff --git a/graph/fixes/fix-floatdecimal-type-mismatch-in-card-builders-card-creatio-52e4aa.md b/graph/fixes/fix-floatdecimal-type-mismatch-in-card-builders-card-creatio-52e4aa.md new file mode 100644 index 00000000000..783be314c8b --- /dev/null +++ b/graph/fixes/fix-floatdecimal-type-mismatch-in-card-builders-card-creatio-52e4aa.md @@ -0,0 +1,12 @@ +--- +id: 52e4aa12-66ea-4c4b-9115-00099e4e4343 +type: fix +title: "Fix: Float/Decimal type mismatch in card builders (card-creation repo)" +tags: [paper-dynasty, card-creation, card_builder, decimal, float, typeerror, type-mismatch] +importance: 0.8 +confidence: 0.8 +created: "2026-02-25T22:26:37.646158+00:00" +updated: "2026-02-25T22:26:37.646158+00:00" +--- + +## Problem\nWhen porting card builders from database (which uses Decimal throughout) to card-creation (which uses float in BattingCardRatingsModel/PitchingCardRatingsModel), all res_chances arithmetic fails. CardColumn.add_result() and FullCard.card_fill() return Decimal tuples while model fields are float, causing TypeError.\n\n## Two Required Fixes\n1. **assign_bchances()/assign_pchances()**: wrap all return values as (float(r_data[0]), float(r_data[1])) before returning\n2. **card.card_fill() call in filler loop**: r_raw = card.card_fill(play_res); r_val = (float(r_raw[0]), float(r_raw[1]))\n\n## What NOT To Do\nDo NOT try to convert res_chances to Decimal at initialization — that would require changing 50+ subtraction lines.