The title says it all, and it's clear where the problem is from the example below. I'm just not 100% sure if this should be handled in Uproot or in Awkward.
>>> import uproot
>>> uproot.__version__
'4.1.2'
>>> with uproot.recreate('test.root') as file_for_writing:
... file_for_writing['tree'] = {'branch': []}
...
>>> uproot.open('test.root')['tree'].arrays()
<Array [] type='0 * {"branch": float64}'>
>>> uproot.lazy('test.root:tree')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/mproffit/miniconda3/lib/python3.9/site-packages/uproot/behaviors/TBranch.py", line 683, in lazy
out = awkward.partition.IrregularlyPartitionedArray(partitions, global_offsets[1:])
File "/home/mproffit/miniconda3/lib/python3.9/site-packages/awkward/partition.py", line 685, in __init__
self._ext = ak._ext.IrregularlyPartitionedArray(nextpartitions, nextstops)
ValueError: PartitionedArray must have at least one partition
(https://github.com/scikit-hep/awkward-1.0/blob/1.5.0/src/libawkward/partition/PartitionedArray.cpp#L19)
The expected behavior would of course be for uproot.lazy() to return an empty Array like arrays() does.
The title says it all, and it's clear where the problem is from the example below. I'm just not 100% sure if this should be handled in Uproot or in Awkward.
The expected behavior would of course be for
uproot.lazy()
to return an emptyArray
likearrays()
does.