a03ebc8472
read_sql may return the wallet_history `bot_managed` Boolean column as an integer dtype (e.g. MySQL/MariaDB TINYINT). results.loc[results["bot_managed"]] then does label-based indexing instead of boolean masking, raising a KeyError on GET /api/v1/historic_balance (HTTP 500). Coerce with .astype(bool).