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

Exporting report with tags to Excel fails #1951

Open
jkl1337 opened this issue Jan 24, 2025 · 1 comment
Open

Exporting report with tags to Excel fails #1951

jkl1337 opened this issue Jan 24, 2025 · 1 comment

Comments

@jkl1337
Copy link

jkl1337 commented Jan 24, 2025

Attempting to export a report containing a frozenset column (so tags at least) to Excel causes a 500 error.

Exception on /beancount/download-query/query_result.xlsx [GET]
Traceback (most recent call last):
  File "/home/hambone/.local/share/uv/tools/fava/lib/python3.13/site-packages/openpyxl/worksheet/_write_only.py", line 133, in _values_to_row
    cell.value = value
    ^^^^^^^^^^
  File "/home/hambone/.local/share/uv/tools/fava/lib/python3.13/site-packages/openpyxl/cell/cell.py", line 218, in value
    self._bind_value(value)
    ~~~~~~~~~~~~~~~~^^^^^^^
  File "/home/hambone/.local/share/uv/tools/fava/lib/python3.13/site-packages/openpyxl/cell/cell.py", line 187, in _bind_value
    raise ValueError("Cannot convert {0!r} to Excel".format(value))
ValueError: Cannot convert frozenset() to Excel

Looks like this might be straightforwardish to fix. I'll look into later.

Additionally if a tags column that is empty gets exported as CSV it comes out as frozenset().

@yagebu
Copy link
Member

yagebu commented Jan 25, 2025

A PR with a fix would be very welcome :)

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

No branches or pull requests

2 participants