python-tabulate icon indicating copy to clipboard operation
python-tabulate copied to clipboard

SEPARATING_LINE does not work with dataclasses

Open baolsen opened this issue 1 year ago • 0 comments

Using tabulate to print a list of dataclasses when one or more rows is SEPARATING_LINE, produces:

  File "....\.venv\lib\site-packages\tabulate\__init__.py", line 1451, in <listcomp>
    rows = [[getattr(row, f) for f in field_names] for row in rows ]
AttributeError: 'str' object has no attribute '<the first attribute of dataclass>'

Can be assigned to me, I have a fix.

baolsen avatar May 23 '23 19:05 baolsen