I'm not sure where FastAPI comes into this story. If you're querying using Python code you're getting Python objects which, with a little bit of data wrangling you should be able to convert to JSON.
On Sun, May 25, 2025 at 7:05 PM 'Alen Šiljak' via Beancount < [email protected]> wrote: > Hi! I have a simple API that runs a bean-query > ``` > select account, convert(value(sum(position)), 'EUR') as value > ``` > to get all current balances in the same currency. Then the result is > serialized by FastAPI. Or at least it tries to. > Unfortunately, it fails to serialize Inventories with > ``` > TypeError: unhashable type: 'list' > ``` > Is there a way to get something serializable - a simple string, or a > number/string combination for the amounts - from the output of convert() > function? > > -- > You received this message because you are subscribed to the Google Groups > "Beancount" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion visit > https://groups.google.com/d/msgid/beancount/7844ca48-d018-4967-90ea-8016d9bf5c49n%40googlegroups.com > <https://groups.google.com/d/msgid/beancount/7844ca48-d018-4967-90ea-8016d9bf5c49n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Beancount" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/beancount/CAK21%2BhNbh7qZfniX27q%3DYUx6XKGEoYF_2PdNs%3Dj9xwei9czgeQ%40mail.gmail.com.
