Skip to content

ListOffsetArray type tracers (from form) raise exception when printing #2042

@lgray

Description

@lgray

Version of Awkward Array

2.0.4

Description and code to reproduce

requires dask_awkward

import dask_awkward as dak
import awkward as ak

form = ak.forms.ListOffsetForm("i64", ak.forms.NumpyForm("float32", inner_shape=(2,)))
tt = dak.typetracer_from_form(form)
print(tt)

results in:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/lgray/miniforge3/envs/coffea-dev/lib/python3.8/site-packages/awkward/highlevel.py", line 1192, in __str__
    return awkward._prettyprint.valuestr(self, 1, 80)
  File "/Users/lgray/miniforge3/envs/coffea-dev/lib/python3.8/site-packages/awkward/_prettyprint.py", line 232, in valuestr
    _, strs = valuestr_horiz(data, limit_cols)
  File "/Users/lgray/miniforge3/envs/coffea-dev/lib/python3.8/site-packages/awkward/_prettyprint.py", line 99, in valuestr_horiz
    if len(data) == 0:
TypeError: 'UnknownLengthType' object cannot be interpreted as an integer

Strangely, tt.__repr__() executes just fine but when going through tt.__str__() I get the error!
This seems to have some knock-on problems elsewhere in dask_awkward when automatically determining typetracer metadata.

Metadata

Metadata

Assignees

Labels

bugThe problem described is something that must be fixed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions