Skip to content

Commit ed1ba7c

Browse files
committed
Added the ability to check to make sure a file is not empty for not iterator root files.
1 parent 9369560 commit ed1ba7c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

servicex_analysis_utils/materialization.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,12 @@ def to_awk(deliver_dict, dask=False, iterator=False, **kwargs):
8484
if iterator == True:
8585
awk_arrays[sample] = iterators # return iterators
8686
else:
87-
awk_arrays[sample] = ak.concatenate(
88-
list(iterators)
89-
) # return array
90-
87+
arrays = list(iterators)
88+
if arrays:
89+
awk_arrays[sample] = ak.concatenate(arrays)
90+
else:
91+
logging.warning(f"No arrays yielded for sample {sample}. Check file content or TTree name.")
92+
awk_arrays[sample] = None
9193
else:
9294
# file is parquet
9395
awk_arrays[sample] = ak.from_parquet(paths, **kwargs)

0 commit comments

Comments
 (0)