Skip to content

Commit

Permalink
Instantiate async filesystem inside the desired loop
Browse files Browse the repository at this point in the history
  • Loading branch information
nsmith- committed Oct 16, 2023
1 parent 7bc543c commit 202783a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/uproot/source/fsspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ def __init__(self, file_path, **options):
if self._fs.async_impl:
self._executor = uproot.source.futures.LoopExecutor()
# Bind the loop to the filesystem
self._fs = fsspec.filesystem(
protocol=self._fs.protocol, loop=self._executor.loop
)
async def make_fs():
return fsspec.filesystem(
protocol=self._fs.protocol, loop=self._executor.loop
)
self._fs = self._executor.submit(make_fs).result()
else:
self._executor = concurrent.futures.ThreadPoolExecutor(
max_workers=self._num_workers
Expand Down

0 comments on commit 202783a

Please sign in to comment.