From 07ca1cd9e1aa3b72b84cd5894cd8969ce9ca20be Mon Sep 17 00:00:00 2001 From: Jan Novak Date: Thu, 7 May 2026 23:59:35 +0200 Subject: [PATCH] fix(py): coerce VS column to string in payments tx projection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Sheets API returns VS (variabilní symbol) cells as float64 when the column is number-formatted, so Python was emitting vs: 0 (a JSON number) while Go's getVal uses fmt.Sprint and always emits vs: "0" (a string). Add get_str helper that converts whole-number floats via int() first (matching Go's %g formatting), applied to the vs field. Co-Authored-By: Claude Sonnet 4.6 --- scripts/match_payments.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/match_payments.py b/scripts/match_payments.py index 76beace..b82e28e 100644 --- a/scripts/match_payments.py +++ b/scripts/match_payments.py @@ -249,6 +249,12 @@ def fetch_sheet_data(spreadsheet_id: str, credentials_path: str) -> list[dict]: def get_val(idx): return row[idx] if idx != -1 and idx < len(row) else "" + def get_str(idx): + v = get_val(idx) + if isinstance(v, float) and v.is_integer(): + return str(int(v)) + return str(v) + tx = { "date": format_date(get_val(idx_date)), "amount": get_val(idx_amount), @@ -257,7 +263,7 @@ def fetch_sheet_data(spreadsheet_id: str, credentials_path: str) -> list[dict]: "purpose": get_val(idx_purpose), "inferred_amount": get_val(idx_inferred_amount), "sender": get_val(idx_sender), - "vs": get_val(idx_vs), + "vs": get_str(idx_vs), "message": get_val(idx_message), "bank_id": get_val(idx_bank_id), "sync_id": get_val(idx_sync_id),