Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions docarray/display/document_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def __rich_console__(
table.add_row(col_1, text.Text(col_2))
elif isinstance(value, AbstractTensor):
table.add_row(col_1, TensorDisplay(tensor=value))
elif isinstance(value, (tuple, list, set)):
elif isinstance(value, (tuple, list, set, frozenset)):
value_list = list(value)
col_2 = ''
for i, x in enumerate(value_list):
Expand All @@ -149,7 +149,7 @@ def __rich_console__(

if type(value) == tuple:
col_2 = col_2.replace('[', '(', 1).replace(']', ')', -1)
if type(value) == set:
if type(value) == set or type(value) == frozenset:
col_2 = col_2.replace('[', '{', 1).replace(']', '}', -1)

table.add_row(col_1, text.Text(col_2))
Expand All @@ -158,6 +158,9 @@ def __rich_console__(
if len(col_2) > 50:
col_2 = f'{col_2[: 50]}' + ' ... } ' + f'(length: {len(value)})'
table.add_row(col_1, text.Text(col_2))
else:
col_2 = f'{value}'
table.add_row(col_1, text.Text(col_2))

if table.rows:
yield table
Expand Down