fsspec / dropboxdrivefs

dropbox implementation for intake module
BSD 3-Clause "New" or "Revised" License
4 stars 8 forks source link

Runtime error: Loop not running #6

Closed dv-rastogi closed 2 years ago

dv-rastogi commented 2 years ago

Hi! I am trying out the following code snippet (from Example.ipynb):

import dropboxdrivefs as dbx
token = 'some-token'
fs = dbx.DropboxDriveFileSystem(token=token)
with fs.open('/test-repo/tester.txt') as file:
     print(file.read())

I am running into the following error:

Traceback (most recent call last):
  File "code.py", line 118, in <module>
    print(file.read())
  File "~/mypy/lib/python3.8/site-packages/fsspec/implementations/http.py", line 566, in read
    return super().read(length)
  File "~/mypy/lib/python3.8/site-packages/fsspec/spec.py", line 1544, in read
    out = self.cache._fetch(self.loc, self.loc + length)
  File "~/mypy/lib/python3.8/site-packages/fsspec/caching.py", line 377, in _fetch
    self.cache = self.fetcher(start, bend)
  File "~/mypy/lib/python3.8/site-packages/fsspec/asyn.py", line 91, in wrapper
    return sync(self.loop, func, *args, **kwargs)
  File "~/mypy/lib/python3.8/site-packages/fsspec/asyn.py", line 46, in sync
    raise RuntimeError("Loop is not running")
RuntimeError: Loop is not running

Edit: It also fails with the same error if I directly create a dropbox file system:

fs = fsspec.filesystem(protocol='dropbox', token=token)
repo_files = fs.find('dropbox:///test-repo/')
with fsspec.open('dropbox:///test-repo/tester.txt', token=token) as f:
    print(f.read())

Kindly also note that other operations work fine, such as find, ls, etc. I am running into this issue with read only. Any and all help would be appreciated! Thanks!

MarineChap commented 2 years ago

Hello, It could be related to this issue https://github.com/fsspec/filesystem_spec/issues/844 A PR fixing it has been merged recently. Can you try with the code installed from the master branch to see if that fixed the error please? Thank you.

dv-rastogi commented 2 years ago

Hi @MarineChap. Thanks for the fix. It works! Will there also be a pypi release with the latest PR?

MarineChap commented 2 years ago

Super, good to know. @martindurant is the one who fix it.

About the release, @martindurant now that it is part of the fsspec project, do you need to be involved in the release process? Or can I just push a release on pypi manually as I did before ? I don't really have the time yet to setup a pipeline for it.

martindurant commented 2 years ago

About the release, @martindurant now that it is part of the fsspec project, do you need to be involved in the release process?

Not at al, do as you would have done. Please ensure that you update any links in setup.py , README, etc., if they weren't already.

MarineChap commented 2 years ago

Ok, then @watch24hrs-iiitd I will push a release with the fix before the end of the week.

dv-rastogi commented 2 years ago

That's great :). Thanks for an active response!

MarineChap commented 2 years ago

I have released on pypi a version 1.3.1. If everything is okay for you, I will close this issue.

Thank you for your feedback. Have a good day

dv-rastogi commented 2 years ago

The latest release incorporates the fixes. Thank you! :)