Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New fava version breaks fava-investor #84

Closed
francocalvo opened this issue Jul 29, 2023 · 3 comments
Closed

New fava version breaks fava-investor #84

francocalvo opened this issue Jul 29, 2023 · 3 comments

Comments

@francocalvo
Copy link

francocalvo commented Jul 29, 2023

Hi! Apparently, v1.2.5 breaks fava_dashboards. For example, I've seen that FavaAPIException is not FavaAPIError in helpers.py.

I get this error:

werkzeug.routing.exceptions.BuildError: Could not build url for endpoint 'extension_report' with values ['bfile', 'module', 'report_name']. Did you forget to specify values ['extension_name']?

Reference:

@redstreet
Copy link
Owner

Good to know, thanks for the references too!

I'll get around to it when I can. Meanwhile, PR welcome from anyone.

@francocalvo
Copy link
Author

I'll take a look at it. Most modules work just adding the correct extension_name.

There is a problem where g.ledger.price_map doesn't exist anymore. Now, it's called g.ledger.price, which returns a ~PriceMap called FavaPriceMap. This is the definition: link to beancount/fava.

When fava-investor tries to convert positions to amounts in assetalloc_class here: permalink to fava-investor/assetalloc_class/libassetalloc, it uses the beancount API, which tries to inverse, which breaks the process. Look:


  File "/home/calvo/Nextcloud/Finanzas/Beans/.venv/lib/python3.10/site-packages/fava_investor/modules/assetalloc_class/libassetalloc.py", line 103, in bucketize
    amount = convert.convert_position(pos, base_currency, price_map, date=end_date)
  File "/home/calvo/Nextcloud/Finanzas/Beans/.venv/lib/python3.10/site-packages/beancount/core/convert.py", line 177, in convert_position
    return convert_amount(pos.units, target_currency, price_map,
  File "/home/calvo/Nextcloud/Finanzas/Beans/.venv/lib/python3.10/site-packages/beancount/core/convert.py", line 202, in convert_amount
    _, rate = prices.get_price(price_map, base_quote, date)
  File "/home/calvo/Nextcloud/Finanzas/Beans/.venv/lib/python3.10/site-packages/beancount/core/prices.py", line 356, in get_price
    return get_latest_price(price_map, base_quote)
  File "/home/calvo/Nextcloud/Finanzas/Beans/.venv/lib/python3.10/site-packages/beancount/core/prices.py", line 329, in get_latest_price
    price_list = _lookup_price_and_inverse(price_map, base_quote)
  File "/home/calvo/Nextcloud/Finanzas/Beans/.venv/lib/python3.10/site-packages/beancount/core/prices.py", line 278, in _lookup_price_and_inverse
    return price_map[base_quote]
TypeError: 'FavaPriceMap' object is not subscriptable

There isn't an obvious way to go from FavaPriceMap to PriceMap, so maybe we can get the amount without the convert_amount method?

@redstreet
Copy link
Owner

redstreet commented Dec 14, 2023

See this comment:

With the latest fixes, everything works except for asset allocation by class, with which the display formatting is incorrect, and is missing the graph. I've opened beancount/fava#1721 for it. Help appreciated.

#87 tracks that issue. Closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants