fix(py): parity coercions — amount/message types + junior '?' sticky #25

Merged
kacerr merged 3 commits from fix/py-parity-coercions into main 2026-05-08 00:26:39 +02:00
Showing only changes of commit 07ca1cd9e1 - Show all commits

View File

@@ -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),