monthly_balance.py generates errors on the bean-example - generated file

23 views
Skip to first unread message

Chary Chary

unread,
Nov 27, 2020, 5:59:24 PM11/27/20
to Beancount
I am just trying to run monthly_balance.py on the file, generated with  bean-example and I get the following error

C:\_code\py\2009 beancount fix>py "C:\_code\py\2009 beancount fix\beancount\experiments\misc\monthly_balance.py" example.bean
Traceback (most recent call last):
  File "C:\_code\py\2009 beancount fix\beancount\experiments\misc\monthly_balance.py", line 66, in <module>
    main()
  File "C:\_code\py\2009 beancount fix\beancount\experiments\misc\monthly_balance.py", line 47, in main
    rtypes, rrows = query.run_query(entries, options_map, sql)
  File "C:\_code\py\2009 beancount fix\beancount\beancount\query\query.py", line 48, in run_query
    rtypes, rrows = query_execute.execute_query(c_query, entries, options_map)
  File "C:\_code\py\2009 beancount fix\beancount\beancount\query\query_execute.py", line 381, in execute_query
    result_types, result_rows = flatten_results(result_types, result_rows)
  File "C:\_code\py\2009 beancount fix\beancount\beancount\query\query_execute.py", line 422, in flatten_results
    value = value[irow] if irow < len(value) else None
KeyError: 0

When I try to remove FLATTEN at the end of the query, it goes further, but produces another error

C:\_code\py\2009 beancount fix>py "C:\_code\py\2009 beancount fix\beancount\experiments\misc\monthly_balance.py" example.bean
Traceback (most recent call last):
  File "C:\_code\py\2009 beancount fix\beancount\experiments\misc\monthly_balance.py", line 65, in <module>
    main()
  File "C:\_code\py\2009 beancount fix\beancount\experiments\misc\monthly_balance.py", line 51, in main
    d = out['{}/{:02d}'.format(row.year, row.month)][row.pos.lot.currency]
AttributeError: 'Inventory' object has no attribute 'lot'

Is this monthly_balance.py  and operational one?


Martin Blais

unread,
Nov 27, 2020, 11:57:21 PM11/27/20
to Beancount
Nothing under /experiments is guaranteed to work, it's not technically part of the beancount release.
(This has just been my sandbox over the years and a place to share some experiments, and reduced scope of the repo in v3 I will move this to another repository eventually. Probably "beanlab" or something like that.)


--
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 beancount+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/551372ea-4fd8-43b1-8757-728e02bd43c1n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages