Skip to content
This repository was archived by the owner on Jan 9, 2023. It is now read-only.

Commit 6372119

Browse files
committed
Avoid yielding empty dataframes
1 parent 6fc6c62 commit 6372119

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

root_pandas/readwrite.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,8 @@ def genchunks():
249249
current_index = 0
250250
for chunk in range(int(ceil(float(n_entries) / chunksize))):
251251
arr = root2array(paths, key, all_vars, start=chunk * chunksize, stop=(chunk+1) * chunksize, selection=where, *args, **kwargs)
252+
if len(arr) == 0:
253+
continue
252254
if flatten:
253255
arr = do_flatten(arr, flatten)
254256
yield convert_to_dataframe(arr, start_index=current_index)

0 commit comments

Comments
 (0)