Skip to content
Open
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
11 changes: 7 additions & 4 deletions servicex_analysis_utils/materialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,13 @@ def to_awk(deliver_dict, dask=False, iterator=False, **kwargs):
if iterator == True:
awk_arrays[sample] = iterators # return iterators
else:
awk_arrays[sample] = ak.concatenate(
list(iterators)
) # return array

arrays = list(iterators)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should rename this var to something like iterator_list, which would make more sense

if arrays:
awk_arrays[sample] = ak.concatenate(arrays)
else:
raise RuntimeError(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be more of a ValueError

f"No arrays yielded for sample {sample}. Check file content or TTree name."
)
else:
# file is parquet
awk_arrays[sample] = ak.from_parquet(paths, **kwargs)
Expand Down