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
doesn't handle the possibility that the RecordArray has no fields (len(contents) == 0).
Very, very few functions actually broadcast through fields; the ufuncs raise an error if they haven't been overloaded (and if they have been overloaded, the use the overload instead), ak.broadcast_arrays stops at records by a deliberate decision:
In our test suite, the only examples that reach the record-broadcasting code (broadcast_any_record, past the part that errors-out when options["allow_records"] is false) are ak.transform and ak.concatenate.
I tried to trigger this error and got a different one:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/jpivarski/irishep/awkward/src/awkward/_dispatch.py", line 64, in dispatch
next(gen_or_result)
File "/home/jpivarski/irishep/awkward/src/awkward/operations/ak_concatenate.py", line 64, in concatenate
return _impl(arrays, axis, mergebool, highlevel, behavior, attrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jpivarski/irishep/awkward/src/awkward/operations/ak_concatenate.py", line 160, in _impl
contents = [ak._do.mergemany(b) for b in batches]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jpivarski/irishep/awkward/src/awkward/operations/ak_concatenate.py", line 160, in <listcomp>
contents = [ak._do.mergemany(b) for b in batches]
^^^^^^^^^^^^^^^^^^^
File "/home/jpivarski/irishep/awkward/src/awkward/_do.py", line 218, in mergemany
return contents[0]._mergemany(contents[1:])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jpivarski/irishep/awkward/src/awkward/contents/recordarray.py", line 760, in _mergemany
next = RecordArray(
^^^^^^^^^^^^
File "/home/jpivarski/irishep/awkward/src/awkward/contents/recordarray.py", line 162, in __init__
raise TypeError(
TypeError: RecordArray 'length' must be a non-negative integer or None, not awkward._util.UNSET
This error occurred while calling
ak.concatenate(
[<Array [{}, {}, {}] type='3 * {}'>, <Array [{}, {}] type='2 * {}'>]
axis = 0
)
It's not a high priority because it's such a weird case, but this really should result in
ak.Array([{}, {}, {}, {}, {}], type='5 * {}'>
The text was updated successfully, but these errors were encountered:
jpivarski
added
bug (unverified)
The problem described would be a bug, but needs to be triaged
bug
The problem described is something that must be fixed
and removed
bug (unverified)
The problem described would be a bug, but needs to be triaged
labels
Sep 26, 2024
Version of Awkward Array
HEAD
Description and code to reproduce
This line:
awkward/src/awkward/_broadcasting.py
Line 471 in e946646
doesn't handle the possibility that the RecordArray has no fields (
len(contents) == 0
).Very, very few functions actually broadcast through fields; the ufuncs raise an error if they haven't been overloaded (and if they have been overloaded, the use the overload instead),
ak.broadcast_arrays
stops at records by a deliberate decision:awkward/src/awkward/operations/ak_broadcast_arrays.py
Line 240 in e946646
In our test suite, the only examples that reach the record-broadcasting code (
broadcast_any_record
, past the part that errors-out whenoptions["allow_records"]
is false) areak.transform
andak.concatenate
.I tried to trigger this error and got a different one:
It's not a high priority because it's such a weird case, but this really should result in
The text was updated successfully, but these errors were encountered: