Skip to content

Commit

Permalink
fix: nbytes repr for typetracers with nbytes=unknown_length (#3361)
Browse files Browse the repository at this point in the history
* fix: nbytes repr for typetracers with nbytes=unknown_length

* improve nbytes repr for unknown_length
  • Loading branch information
pfackeldey authored Jan 7, 2025
1 parent 22b364a commit 19ffb38
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/awkward/prettyprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from awkward._layout import wrap_layout
from awkward._namedaxis import _prettify_named_axes
from awkward._nplikes.numpy import Numpy, NumpyMetadata
from awkward._nplikes.shape import unknown_length
from awkward._typing import TYPE_CHECKING, Any, TypeAlias, TypedDict

if TYPE_CHECKING:
Expand Down Expand Up @@ -487,7 +488,10 @@ def highlevel_array_show_rows(
)
rows.append(named_axis_line)
if nbytes:
nbytes_line = f"nbytes: {bytes_repr(array.nbytes)}"
if array.nbytes is unknown_length:
nbytes_line = "nbytes: unknown"
else:
nbytes_line = f"nbytes: {bytes_repr(array.nbytes)}"
rows.append(nbytes_line)
if backend:
backend_line = f"backend: {array.layout.backend.name}"
Expand Down

0 comments on commit 19ffb38

Please sign in to comment.