Skip to content

Commit

Permalink
handle trivial executor
Browse files Browse the repository at this point in the history
  • Loading branch information
lobis committed Oct 15, 2023
1 parent c588cea commit 7dd99fb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/uproot/source/fsspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,10 @@ def chunks(

chunks = []
# _cat_file is async while cat_file is not
cat_file = self._fs._cat_file if self._fs.async_impl else self._fs.cat_file
is_async = (
self._fs.async_impl and type(self._executor).__name__ == "LoopExecutor"
)
cat_file = self._fs._cat_file if is_async else self._fs.cat_file
for start, stop in ranges:
future = self._executor.submit(cat_file, self._file_path, start, stop)
chunk = uproot.source.chunk.Chunk(self, start, stop, future)
Expand Down

0 comments on commit 7dd99fb

Please sign in to comment.