You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tabulate.SEPARATING_LINE does not work when the table consists of dictionaries and keys are used as headers:
>>> table = [{"name": "Ben"}, {"name": "Adam"}]
>>> print(tabulate.tabulate(table, headers="keys"))
name
------
Ben
Adam
>>> table = [{"name": "Ben"}, tabulate.SEPARATING_LINE, {"name": "Adam"}]
>>> print(tabulate.tabulate(table, headers="keys"))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/fui4fe/.local/lib/python3.10/site-packages/tabulate/__init__.py", line 2048, in tabulate
list_of_lists, headers = _normalize_tabular_data(
File "/home/fui4fe/.local/lib/python3.10/site-packages/tabulate/__init__.py", line 1409, in _normalize_tabular_data
for k in row.keys():
AttributeError: 'str' object has no attribute 'keys'
Expected behaivour:
>>> table = [{"name": "Ben"}, tabulate.SEPARATING_LINE, {"name": "Adam"}]
>>> print(tabulate.tabulate(table, headers="keys"))
name
------
Ben
------
Adam
The text was updated successfully, but these errors were encountered:
tabulate.SEPARATING_LINE
does not work when the table consists of dictionaries and keys are used as headers:Expected behaivour:
The text was updated successfully, but these errors were encountered: