Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions src/awkward/highlevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -1456,6 +1456,7 @@ def show(
# it's always the second row (after the array)
type_line = rows.pop(0)
out_io.write(type_line)
out_io.write("\n")

# the rest of the rows we sort by the length of their '<prefix>:'
# but we sort it from shortest to longest contrary to _repr_mimebundle_
Expand Down Expand Up @@ -2402,6 +2403,7 @@ def show(
# it's always the second row (after the array)
type_line = rows.pop(0)
out_io.write(type_line)
out_io.write("\n")

# the rest of the rows we sort by the length of their '<prefix>:'
# but we sort it from shortest to longest contrary to _repr_mimebundle_
Expand Down
6 changes: 6 additions & 0 deletions src/awkward/prettyprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,9 @@ def highlevel_array_show_rows(
array.type.show(stream=typeio)
type_line = "type: "
type_line += typeio.getvalue().removesuffix("\n")
# crop type line if too long
if len(type_line) > limit_cols:
type_line = type_line[: limit_cols - 3] + "..."
rows.append(type_line)

# other info
Expand All @@ -495,6 +498,9 @@ def highlevel_array_show_rows(
named_axis_line += _prettify_named_axes(
array.named_axis, delimiter=", ", maxlen=None
)
# crop named axis line if too long
if len(named_axis_line) > limit_cols:
named_axis_line = named_axis_line[: limit_cols - 3] + "..."
rows.append(named_axis_line)
if nbytes:
if array.nbytes is unknown_length:
Expand Down
Loading